Changeset View
Changeset View
Standalone View
Standalone View
assets/src/bundles/browse/browse-utils.js
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | $('.swh-popover-toggler').on('show.bs.popover', (e) => { | ||||||||
$('.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'); | ||||||||
}); | }); | ||||||||
$('#swh-branch-name-search').keyup(function(e) { | |||||||||
anlambert: You should rather listen for the `submit` event of the form here, see comment in… | |||||||||
var branchName = $(this).val().trim(); | |||||||||
ardumontUnsubmitted 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… | |||||||||
if (e.which === 13) { | |||||||||
ardumontUnsubmitted 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? | |||||||||
// On return key press event | |||||||||
var searchParams = new URLSearchParams(window.location.search); | |||||||||
searchParams.set('branch-name-include', branchName); | |||||||||
anlambertUnsubmitted 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… | |||||||||
anlambertUnsubmitted Not Done Inline Actionss/works/words/ anlambert: s/works/words/ | |||||||||
window.location.search = searchParams.toString(); | |||||||||
} | |||||||||
}); | |||||||||
$('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.