TimeTrex/interface/html5/dist/awesomebox-ASearchInput.bundle.js

1 line
5.7 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["awesomebox-ASearchInput"],{7040:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ASearchInput = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ADropDown.defaults, options );\n\n\t\tvar column_model = null;\n\n\t\tvar search_timer = null;\n\n\t\tvar $this = this;\n\t\tvar default_tooltip = $.i18n._( 'click to search' );\n\n\t\tthis.setFilter = function( filters ) {\n\t\t\tvar field = column_model.name;\n\n\t\t\tif ( Global.isSet( filters[field] ) ) {\n\t\t\t\t$( this ).val( filters[field] );\n\t\t\t\t$( this ).addClass( 'search-input-focus-in' );\n\t\t\t}\n\t\t};\n\n\t\tthis.clearValue = function() {\n\t\t\t$( this ).val( default_tooltip );\n\t\t\t$( this ).removeClass( 'search-input-focus-in' );\n\t\t\t$( this ).addClass( 'search-input-focus-out' );\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tif ( o.column_model ) {\n\n\t\t\t\tcolumn_model = o.column_model;\n\t\t\t}\n\n\t\t\t$( this ).addClass( 'search-input-focus-out' );\n\n\t\t\t$( this ).val( default_tooltip );\n\n\t\t\t$( this ).focusin( function() {\n\n\t\t\t\tif ( $( this ).val() === default_tooltip ) {\n\t\t\t\t\t$( this ).val( '' );\n\t\t\t\t\t$( this ).addClass( 'search-input-focus-in' );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t$( this ).focusout( function() {\n\t\t\t\tif ( $( this ).val() === '' ) {\n\t\t\t\t\t$( this ).val( default_tooltip );\n\t\t\t\t\t$( this ).removeClass( 'search-input-focus-in' );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t$( this ).bind( 'input propertychange', function( e ) {\n\n\t\t\t\tif ( search_timer ) {\n\t\t\t\t\tclearTimeout( search_timer );\n\t\t\t\t}\n\n\t\t\t\tif ( e.keyCode === 91 || e.ctrlKey || e.metaKey || e.keyCode === 17 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsearch_timer = setTimeout( function() {\n\n\t\t\t\t\tvar val = ( $this.val() === default_tooltip ) ? '' : $this.val();\n\n\t\t\t\t\t$this.trigger( 'searchEnter', [val, column_model.name] );\n\n\t\t\t\t}, 500 );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.ASearchInput.defaults = {};\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzA0MC5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7O0FBRXpCOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUEsZ0NBQWdDOztBQUVoQzs7QUFFQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLEtBQUs7O0FBRUw7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxLQUFLOztBQUVMOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7O0FBRUEsS0FBSzs7QUFFTCxLQUFLOztBQUVMLElBQUk7O0FBRUo7O0FBRUE7O0FBRUE7O0FBRUEsRUFBRSxHQUFHLE1BQU0iLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvZ2xvYmFsL3dp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