TimeTrex/interface/html5/dist/jqgrid-TGridHeader.bundle.js

1 line
5.4 KiB
JavaScript

(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["jqgrid-TGridHeader"],{754:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TGridHeader = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.TGridHeader.defaults, options );\n\n\t\tvar sort_type = true;\n\n\t\tvar sort_number = null;\n\n\t\tvar column_model = null; //Column model from Grid\n\n\t\tvar $this = this;\n\n\t\tGlobal.addCss( 'global/widgets/jqgrid/TGridHeader.css' );\n\n\t\tthis.getColumnModel = function() {\n\t\t\treturn column_model;\n\t\t};\n\n\t\tthis.setSortStyle = function( sort_type, index ) {\n\t\t\tvar sortIcon = $( '<img class=\\'t-grid-header-sort-icon\\'></img>' );\n\n\t\t\tif ( sort_type === 'asc' ) {\n\n\t\t\t\tsortIcon.attr( 'src', Global.getRealImagePath( 'images/sort_up.png' ) );\n\n\t\t\t} else {\n\t\t\t\tsortIcon.attr( 'src', Global.getRealImagePath( 'images/sort_down.png' ) );\n\t\t\t}\n\n\t\t\tthis.append( sortIcon );\n\n\t\t\tif ( index > 0 ) {\n\t\t\t\tvar sortNumberSpan = $( '<span class=\\'t-grid-header-sort-number\\'>' + index + '</span>' );\n\n\t\t\t\tthis.append( sortNumberSpan );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getWidth = function() {\n\t\t\treturn $( this ).parent().width();\n\t\t};\n\n\t\tthis.cleanSortStyle = function() {\n\t\t\tvar sortIcon = this.find( 'img' );\n\t\t\tvar sort_number = this.find( 'span[class=t-grid-header-sort-number]' );\n\n\t\t\tif ( sortIcon.length > 0 ) {\n\t\t\t\t$( sortIcon ).remove();\n\t\t\t}\n\n\t\t\tif ( sort_number.length > 0 ) {\n\t\t\t\t$( sort_number ).remove();\n\t\t\t}\n\t\t};\n\n\t\t//For multiple items like .xxx could contains a few widgets.\n\t\tthis.each( function() {\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 ).click( function( e ) {\n\n\t\t\t\t$( $this ).trigger( 'headerClick', [e, column_model] );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TGridHeader.defaults = {};\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzU0LmpzIiwibWFwcGluZ3MiOiI7QUFBQTs7QUFFQTtBQUNBLHlCQUF5Qjs7QUFFekI7O0FBRUE7O0FBRUEsMkJBQTJCOztBQUUzQjs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLGdDQUFnQzs7QUFFaEM7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQSxLQUFLOztBQUVMLElBQUk7O0FBRUo7O0FBRUE7O0FBRUE7O0FBRUEsRUFBRSxHQUFHLE1BQU0iLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvZ2xvYmFsL3dpZGdldHMvanFncmlkL1RHcmlkSGVhZGVyLmpzPzJjNzYiXSwic291cmNlc0NvbnRlbnQiOlsiKCBmdW5jdGlvbiggJCApIHtcblxuXHQkLmZuLlRHcmlkSGVhZGVyID0gZnVuY3Rpb24oIG9wdGlvbnMgKS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