TimeTrex/interface/html5/dist/error_tip-ErrorTipBox.bundle.js

1 line
5.0 KiB
JavaScript

(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["error_tip-ErrorTipBox"],{9876:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ErrorTipBox = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ErrorTipBox.defaults, options );\n\t\tvar $this = this;\n\t\tvar related_widget;\n\t\tvar timer;\n\n\t\tGlobal.addCss( 'global/widgets/error_tip/ErrorTipBox.css' );\n\n\t\tthis.cancelRemove = function() {\n\t\t\tif ( Global.isSet( timer ) ) {\n\t\t\t\tclearTimeout( timer );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.show = function( target, error_string, sec, isWarning ) {\n\t\t\trelated_widget = target;\n\n\t\t\tif ( isWarning ) {\n\t\t\t\t$( this ).addClass( 'warningtip-box' );\n\t\t\t} else {\n\t\t\t\t$( this ).removeClass( 'warningtip-box' );\n\t\t\t}\n\n\t\t\tif ( $.type( error_string ) === 'array' ) {\n\t\t\t\terror_string = error_string.join( '<br>' );\n\t\t\t}\n\n\t\t\tvar error_tip_label = $( this ).find( '.errortip-label' );\n\t\t\terror_tip_label.html( error_string );\n\n\t\t\t$( this ).css( 'left', related_widget.offset().left + related_widget.width() + 5 );\n\n\t\t\tif ( related_widget.hasClass( 'a-combobox' ) ) {\n\t\t\t\t$( this ).css( 'top', related_widget.offset().top );\n\t\t\t} else {\n\t\t\t\t$( this ).css( 'top', related_widget.offset().top );\n\t\t\t}\n\n\t\t\t$( 'body' ).append( this );\n\n\t\t\tif ( sec > 0 ) {\n\t\t\t\ttimer = setTimeout( function() {\n\t\t\t\t\t$this.remove();\n\t\t\t\t}, sec * 1000 );\n\t\t\t}\n\t\t};\n\n\t\tthis.remove = function() {\n\t\t\t$( this ).remove();\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} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.ErrorTipBox.defaults = {};\n\t$.fn.ErrorTipBox.html_template = `\n\t<div class=\"errortip-box\">\n\t\t<span class=\"errortip-label\"></span>\n\t</div>\n\t`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTg3Ni5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7QUFDekI7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUEsZ0NBQWdDOztBQUVoQyxJQUFJOztBQUVKOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxFQUFFLEdBQUcsTUFBTSIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2ludGVyZmFjZS9odG1sNS9nbG9iYWwvd2lkZ2V0cy9lcnJvcl90aXAvRXJyb3JUaXBCb3guanM/ZDNmNSJdLCJzb3VyY2VzQ29udGVudCI6WyIoIGZ1bmN0aW9uKCAkICkge1xuXG5cdCQuZm4uRXJyb3JUaXBCb3ggPSBmdW5jdGlvbiggb3B0aW9ucyApIHtcblx0XHR2YXIgb3B0cyA9ICQuZXh0ZW5kKCB7fSwgJC5mbi5FcnJvclRpcEJveC5kZWZhdWx0cywgb3B0aW9ucyApO1xuXHRcdH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