TimeTrex/interface/html5/dist/text-TText.bundle.js

1 line
4.7 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["text-TText"],{7011:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TText = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.TText.defaults, options );\n\n\t\tvar $this = this;\n\t\tvar field;\n\n\t\tthis.clearErrorStyle = function() {\n\n\t\t};\n\n\t\tthis.setClassStyle = function( style ) {\n\t\t\tif ( style ) {\n\t\t\t\tthis.css( style );\n\t\t\t}\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.getValue = function() {\n//\t\t\treturn\t$this.val();\n\t\t\treturn $this.text();\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\t\t\tif ( !val && val !== 0 ) {\n\t\t\t\tval = $.i18n._( 'N/A' );\n\t\t\t}\n\n\t\t\tval = Global.decodeCellValue( val );\n\t\t\t$this.html( ( val ) );\n\n\t\t\tthis.setResizeEvent();\n\t\t};\n\n\t\tthis.setResizeEvent = function() {\n\t\t\t$this.height( 'auto' );\n\n\t\t\t//Set label size if there is new lines in contents\n\t\t\t//if set value before add widget to UI, the height is 0, get the height so the event can be correct\n\t\t\tif ( $this.height() === 0 ) {\n\t\t\t\tvar temp_span = $this.clone();\n\t\t\t\t$( 'body' ).append( temp_span );\n\t\t\t\t$this.height( temp_span.height() );\n\t\t\t\ttemp_span.remove();\n\n\t\t\t}\n\n\t\t\t$this.trigger( 'setSize' );\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\tfield = o.field;\n\n\t\t\tif ( o.selected_able ) {\n\t\t\t\t$( this ).addClass( 't-text-selected-able' );\n\t\t\t}\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TText.defaults = {};\n\t$.fn.TText.html_template = `<span type=\"text\" class=\"t-text\"/>`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAxMS5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7O0FBRXpCO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQSxnQ0FBZ0M7O0FBRWhDOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSxJQUFJOztBQUVKOztBQUVBOztBQUVBO0FBQ0E7O0FBRUEsRUFBRSxHQUFHLE1BQU0iLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvZ2xvYmFsL3dpZGdldHMvdGV4dC9UVGV4dC5qcz9hYjhmIl0sInNvdXJjZXNDb250ZW50IjpbIiggZnVuY3Rpb24oICQgKSB7XG5cblx0JC5mbi5UVGV4dCA9IGZ1bmN0aW9uKCBvcHRpb25zICkge1xuXHRcdHZhciBvcHRzID0gJC5leHRlbmQoIHt9LCAkLmZuLlRUZXh0LmRlZmF1bHRzLCBvcHRpb25zICk7XG5cblx0XHR2YXIgJHRoaXMgPSB0aGlzO1xuXHRcdHZhciBmaWVsZDtcblxuXHRcdHRoaXMuY2xlYXJFcnJvclN0eWxlID0gZnVuY3Rpb24oKSB7XG5cblx0XHR9O1xuXG5cdFx0dGhpcy5zZX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