1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
|
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["column_editor-ColumnEditor"],{9613:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ColumnEditor = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ColumnEditor.defaults, options );\n\n\t\tvar parent_awesome_box = null;\n\n\t\tvar a_dropdown = null;\n\n\t\tvar $this = this;\n\n\t\tvar is_mouse_over = false;\n\n\t\tvar layout_selector = null;\n\n\t\tvar user_generic_data_api = null;\n\n\t\tvar related_layout_Array = null;\n\n\t\tvar all_columns;\n\n\t\tvar original_columns;\n\n\t\tvar numArray = [\n\t\t\t{ label: $.i18n._( 'Default' ), value: 0 },\n\t\t\t{ label: 5, value: 5 },\n\t\t\t{ label: 10, value: 10 },\n\t\t\t{\n\t\t\t\tlabel: 15,\n\t\t\t\tvalue: 15\n\t\t\t},\n\t\t\t{ label: 20, value: 20 },\n\t\t\t{ label: 25, value: 25 },\n\t\t\t{ label: 50, value: 50 },\n\t\t\t{\n\t\t\t\tlabel: 100,\n\t\t\t\tvalue: 100\n\t\t\t},\n\t\t\t{ label: 250, value: 250 },\n\t\t\t{ label: 500, value: 500 },\n\t\t\t{ label: 1000, value: 1000 }\n\t\t];\n\n\t\tthis.getIsMouseOver = function() {\n\t\t\treturn is_mouse_over;\n\t\t};\n\n\t\tthis.getParentAwesomeBox = function() {\n\t\t\treturn parent_awesome_box;\n\t\t};\n\n\t\tGlobal.addCss( 'global/widgets/column_editor/ColumnEditor.css' );\n\n\t\tthis.show = function() {\n\n\t\t\tif ( LocalCacheData.openAwesomeBoxColumnEditor ) {\n\n\t\t\t\tif ( LocalCacheData.openAwesomeBoxColumnEditor.getParentAwesomeBox().getId() === parent_awesome_box.getId() ) {\n\t\t\t\t\tLocalCacheData.openAwesomeBoxColumnEditor.onClose();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tLocalCacheData.openAwesomeBoxColumnEditor.onClose();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar layout = parent_awesome_box.getLayout();\n\t\t\tvar a_dropdown_div = $( this ).find( '.column-editor-drop-down-div' );\n\n\t\t\tvar rows_per_page_div = $( this ).find( '.rows-per-page-div' );\n\n\t\t\ta_dropdown = Global.loadWidgetByName( FormItemType.AWESOME_DROPDOWN );\n\t\t\t//Create ADropDown\n\t\t\ta_dropdown = a_dropdown.ADropDown( {\n\t\t\t\tdisplay_show_all: false,\n\t\t\t\tid: 'column_editor',\n\t\t\t\tkey: 'value',\n\t\t\t\tdisplay_close_btn: false,\n\t\t\t\tdisplay_column_settings: false,\n\t\t\t\tstatic_height: 150,\n\t\t\t\tresize_grids: true\n\t\t\t} );\n\n\t\t\ta_dropdown_div.append( a_dropdown );\n\n\t\t\t//Add Self to UI\n\t\t\t$( 'body' ).append( $( this ).css( 'visibility', 'hidden' ) ); // #2734 - Add to DOM but invisible so code can do calculations, but user does not see flashes.\n\n\t\t\ta_dropdown.setColumns( [\n\t\t\t\t{ name: 'label', index: 'label', label: $.i18n._( 'Column Name' ), width: 100, sortable: false }\n\t\t\t] );\n\n\t\t\ta_dropdown.setUnselectedGridData( parent_awesome_box.getAllColumns() );\n\n\t\t\toriginal_columns = parent_awesome_box.getDisplayColumnsForEditor();\n\t\t\ta_dropdown.setSelectGridData( original_columns );\n\n\t\t\ta_dropdown.setResizeGrids( true );\n\n\t\t\t//Set position\n\t\t\tif ( 958 + $( parent_awesome_box ).offset().left + 50 > Global.bodyWidth() ) {\n\t\t\t\t$( this ).css( 'left', Global.bodyWidth() - 958 - 50 );\n\t\t\t} else {\n\n\t\t\t\t$( this ).css( 'left', $( parent_awesome_box ).offset().left );\n\t\t\t}\n\n\t\t\tvar $$this = this;\n\t\t\tsetTimeout( function() {\n\t\t\t\tif ( ( $( $$this ).height() + $( parent_awesome_box ).offset().top + 50 ) > Global.bodyHeight() ) {\n\t\t\t\t\t$( $$this ).css( 'top', ( Global.bodyHeight() - $( $$this ).height() - 25 ) );\n\t\t\t\t} else {\n\t\t\t\t\t$( $$this ).css( 'top', $( parent_awesome_box ).offset().top + 25 );\n\t\t\t\t}\n\t\t\t\t$( $$this ).css( 'visibility', 'visible' ); // show once all positions and sizes are done calculating and moving.\n\t\t\t}, 100 );\n\n\t\t\t$( this ).mouseenter( function() {\n\t\t\t\tis_mouse_over = true;\n\t\t\t} );\n\n\t\t\t$( this ).mouseleave( function( e ) {\n\t\t\t\t// Issue #2853 - This comparison fixes an issue where firefox improperly triggers mouseleave on select menus.\n\t\t\t\tif ( e.target == this )
|