Changeset View
Changeset View
Standalone View
Standalone View
assets/src/bundles/browse/browse-utils.js
/** | /** | ||||
* Copyright (C) 2018-2020 The Software Heritage developers | * Copyright (C) 2018-2020 The Software Heritage developers | ||||
anlambert: 2018-2021 | |||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
import {BREAKPOINT_SM} from 'utils/constants'; | import {BREAKPOINT_SM} from 'utils/constants'; | ||||
$(document).ready(() => { | $(document).ready(() => { | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | $(document).ready(() => { | ||||
$('.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-search-form').submit(function(e) { | $('#swh-branch-search-form').submit(function(e) { | ||||
var searchParams = new URLSearchParams(window.location.search); | var searchParams = new URLSearchParams(window.location.search); | ||||
const searchString = $('#swh-branch-search-string').val().trim(); | searchParams.set('branch_name_include', | ||||
searchParams.set('branch_name_include', searchString); | $('#swh-branch-search-string').val().trim()); | ||||
window.location.search = searchParams.toString(); | |||||
e.preventDefault(); | |||||
}); | |||||
$('#swh-release-search-form').submit(function(e) { | |||||
var searchParams = new URLSearchParams(window.location.search); | |||||
searchParams.set('release_name_include', | |||||
$('#swh-release-search-string').val().trim()); | |||||
window.location.search = searchParams.toString(); | window.location.search = searchParams.toString(); | ||||
e.preventDefault(); | 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 17 Lines |
2018-2021