- gitlist.git
- public
- js
- search-branch.js
This file ( 1kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
document.addEventListener("DOMContentLoaded", function(event) {
const menuResponsive = require('./menu-responsive')
menuResponsive({
menuList: $('#p3x-gitlist-branch-list-dropdown-menu'),
})
const List = require('list.js')
const mainId = 'p3x-gitlist-branch-list'
const branchListId = 'p3x-gitlist-list-branch'
const tagListId = 'p3x-gitlist-list-tag'
const debounce = require('lodash/debounce')
if ($(`#${mainId}`).length) {
const listBranchOptions = {
valueNames: ['item'],
indexAsync: true,
};
const branchList = new List(branchListId, listBranchOptions);
const tagList = new List(tagListId, listBranchOptions);
const input = $('#p3x-gitlist-branch-list-search');
const debouncedKeyup = debounce(() => {
const search = input.val().trim();
branchList.search(search)
tagList.search(search)
}, 500)
input.keyup(debouncedKeyup)
}
})