mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
- clarifies search progress in subtitle of edit/current histories - corrects found display in subtitle when no results are found - does not cause a search and render when entering the same terms - does not clear search on full backspace or cut of input text - does not cause clear and render if no previous terms existed - removes onchange from search input (not needed yet)
2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
!function(a){"function"==typeof define&&define.amd?define([],a):a(jQuery)}(function(){function a(a,c){function d(){var a=$(this).parent().children("input");a.val("").trigger("searchInput.clear").blur(),c.onclear()}function e(a,b){return b?($(this).trigger("search.search",b),void("function"==typeof c.onfirstsearch&&n?(n=!1,c.onfirstsearch(b)):c.onsearch(b))):d()}function f(){return['<input type="text" name="',c.name,'" placeholder="',c.placeholder,'" ','class="search-query ',c.classes,'" ',"/>"].join("")}function g(){return $(f()).focus(function(){$(this).select()}).keyup(function(a){if(a.preventDefault(),a.stopPropagation(),a.which===k&&c.escWillClear)d.call(this,a);else{var b=$(this).val();(a.which===l||c.minSearchLen&&b.length>=c.minSearchLen)&&e.call(this,a,b)}}).val(c.initialVal)}function h(){return $(['<span class="search-clear fa fa-times-circle" ','title="',b("clear search (esc)"),'"></span>'].join("")).tooltip({placement:"bottom"}).click(function(a){d.call(this,a)})}function i(){return $(['<span class="search-loading fa fa-spinner fa-spin" ','title="',b("loading..."),'"></span>'].join("")).hide().tooltip({placement:"bottom"})}function j(){m.find(".search-loading").toggle(),m.find(".search-clear").toggle()}var k=27,l=13,m=$(a),n=!0,o={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(){},minSearchLen:0,escWillClear:!0,oninit:function(){}};return"string"===jQuery.type(c)?("toggle-loading"===c&&j(),m):("object"===jQuery.type(c)&&(c=jQuery.extend(!0,{},o,c)),m.addClass("search-input").prepend([g(),h(),i()]))}var b=window._l||function(a){return a};jQuery.fn.extend({searchInput:function(b){return this.each(function(){return a(this,b)})}})});
|
|
//# sourceMappingURL=../../maps/ui/search-input.js.map
|