Changeset View
Changeset View
Standalone View
Standalone View
assets/src/bundles/browse/browse-utils.js
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | $('.swh-popover-toggler').on('show.bs.popover', (e) => { | ||||||||
$(`.swh-popover-toggler:not(#${e.currentTarget.id})`).popover('hide'); | $(`.swh-popover-toggler:not(#${e.currentTarget.id})`).popover('hide'); | ||||||||
$('.swh-vault-menu .dropdown-menu').hide(); | $('.swh-vault-menu .dropdown-menu').hide(); | ||||||||
}); | }); | ||||||||
$('.swh-actions-dropdown').on('hide.bs.dropdown', () => { | $('.swh-actions-dropdown').on('hide.bs.dropdown', () => { | ||||||||
$('.swh-vault-menu .dropdown-menu').hide(); | $('.swh-vault-menu .dropdown-menu').hide(); | ||||||||
$('.swh-popover-toggler').popover('hide'); | $('.swh-popover-toggler').popover('hide'); | ||||||||
}); | }); | ||||||||
anlambert: You should rather listen for the `submit` event of the form here, see comment in… | |||||||||
$('#swh-branch-search-form').submit(function(e) { | |||||||||
Not Done Inline Actions
No need to make it a "variable", let's keep it an immutable value by default (either let or const should be good enough here). ardumont: No need to make it a "variable", let's keep it an immutable value by default (either let or… | |||||||||
var searchParams = new URLSearchParams(window.location.search); | |||||||||
Not Done Inline Actionsisn't there some keycode named so the code is more readable than a 13 code? ardumont: isn't there some keycode named so the code is more readable than a 13 code? | |||||||||
const searchString = $('#swh-branch-search-string').val().trim(); | |||||||||
searchParams.set('branch_name_include', searchString); | |||||||||
window.location.search = searchParams.toString(); | |||||||||
Not Done Inline ActionsPlease use underscore to separate the works for consistency with other query parameters of swh-web endpoints. anlambert: Please use underscore to separate the works for consistency with other query parameters of `swh… | |||||||||
Not Done Inline Actionss/works/words/ anlambert: s/works/words/ | |||||||||
e.preventDefault(); | |||||||||
}); | |||||||||
$('body').on('click', e => { | $('body').on('click', e => { | ||||||||
if ($(e.target).parents('.swh-popover').length) { | if ($(e.target).parents('.swh-popover').length) { | ||||||||
e.stopPropagation(); | e.stopPropagation(); | ||||||||
} | } | ||||||||
}); | }); | ||||||||
}); | }); | ||||||||
Show All 13 Lines |
You should rather listen for the submit event of the form here, see comment in swh/web/templates/browse/branches.html.