1 line
6.6 KiB
JavaScript
1 line
6.6 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["switch_button-SwitchButton"],{6618:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SwitchButtonIcon\": () => (/* binding */ SwitchButtonIcon)\n/* harmony export */ });\n/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.SwitchButton = function( options ) {\n\n\t\tGlobal.addCss( 'global/widgets/switch_button/SwitchButton.css' );\n\t\tvar opts = $.extend( {}, $.fn.SwitchButton.defaults, options );\n\n\t\tvar $this = this;\n\n\t\tvar btn = null;\n\n\t\tvar enabled = true;\n\n\t\tthis.getEnabled = function() {\n\t\t\treturn enabled;\n\t\t};\n\n\t\tthis.setEnable = function( val ) {\n\t\t\tenabled = val;\n\n\t\t\tif ( !val ) {\n\t\t\t\tthis.removeClass( 'disable-element' ).addClass( 'disable-element' );\n\t\t\t} else {\n\t\t\t\tthis.removeClass( 'disable-element' );\n\t\t\t}\n\n\t\t};\n\n\t\t//Error: TypeError: btn is null in /interface/html5/global/widgets/switch_button/SwitchButton.js?v=9.0.0-20150822-212724 line 31\n\t\tthis.getValue = function( return_number ) {\n\t\t\tif ( return_number ) {\n\t\t\t\treturn ( btn && btn.hasClass( 'selected' ) ) ? 1 : 0;\n\t\t\t} else {\n\t\t\t\treturn ( btn && btn.hasClass( 'selected' ) ) ? true : false;\n\t\t\t}\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\n\t\t\t//Error: TypeError: btn is null in /interface/html5/global/widgets/switch_button/SwitchButton.js?v=8.0.0-20141230-130626 line 35\n\t\t\tif ( !btn ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbtn.removeClass( 'selected' );\n\n\t\t\tif ( val ) {\n\t\t\t\tbtn.addClass( 'selected' );\n\t\t\t}\n\t\t};\n\n\t\tthis.setIcon = function( val ) {\n\t\t\tbtn.addClass( val );\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\tbtn = $( '<div></div>' );\n\n\t\t\t$this.append( btn );\n\n\t\t\tif ( o.tooltip ) {\n\t\t\t\tbtn.attr( 'title', o.tooltip );\n\t\t\t}\n\n\t\t\t$this.setIcon( o.icon );\n\n\t\t\tbtn.click( function( e ) {\n\n\t\t\t\tif ( !enabled ) {\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.setValue( !$this.getValue() );\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.SwitchButton.defaults = {};\n\n} )( jQuery );\n\nvar SwitchButtonIcon = function() {\n\n};\n\nSwitchButtonIcon.daily_total = 'daily';\nSwitchButtonIcon.weekly_total = 'weekly';\nSwitchButtonIcon.all_employee = 'all-employee';\nSwitchButtonIcon.strict_range = 'strict-range';\nSwitchButtonIcon.wages = 'strict-range';//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYxOC5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUFBOztBQUVBOztBQUVBO0FBQ0EseUJBQXlCOztBQUV6Qjs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFF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