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

1 line
5.4 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzU0LmpzIiwibWFwcGluZ3MiOiI7QUFBQTs7QUFFQTtBQUNBLHlCQUF5Qjs7QUFFekI7O0FBRUE7O0FBRUEsMkJBQTJCOztBQUUzQjs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLGdDQUFnQzs7QUFFaEM7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQSxLQUFLOztBQUVMLElBQUk7O0FBRUo7O0FBRUE7O0FBRUE7O0FBRUEsRUFBRSxHQUFHLE1BQU0iLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvZ2xvYmFsL3dpZGdldHMvanFncmlkL1RHcmlkSGVhZGVyLmpzPzJjNzYiXSwic291cmNlc0NvbnRlbnQiOlsiKCBmdW5jdGlvbiggJCApIHtcblxuXHQkLmZuLlRHcmlkSGVhZG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