TimeTrex/interface/html5/dist/message_box-SaveAndContinueBox.bundle.js

1 line
4.7 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["message_box-SaveAndContinueBox"],{350:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.SaveAndContinueBox = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.SaveAndContinueBox.defaults, options );\n\t\tvar field;\n\t\tvar related_view_controller;\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tif ( o.related_view_controller ) {\n\t\t\t\trelated_view_controller = o.related_view_controller;\n\t\t\t}\n\n\t\t\tvar label = $( this ).find( '.p-button-label' );\n\t\t\tvar icon = $( this ).find( '.icon' );\n\t\t\tvar message = $( this ).find( '.message' );\n\n\t\t\tvar ribbon_button = $( this ).find( '.p-button' );\n\n\t\t\tmessage.text( Global.save_and_continue_message );\n\t\t\ticon.addClass('tticon tticon tticon-save_black_24dp');\n\t\t\tlabel.html( $.i18n._( 'Save & Continue' ) );\n\n\t\t\tvar context_menu_array = ContextMenuManager.getMenuModelByMenuId( related_view_controller.determineContextMenuMountAttributes().id );\n\t\t\tvar len = context_menu_array.length;\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\tlet context_btn = context_menu_array[i];\n\t\t\t\tlet id = context_btn.id;\n\n\t\t\t\tif ( id === 'save_and_continue' ) {\n\t\t\t\t\tif ( !context_btn.visible || context_btn.disabled ) {\n\t\t\t\t\t\tribbon_button.addClass( 'disable-image' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tribbon_button.off( 'click' ).on( 'click', function() {\n\n\t\t\t\tif ( ribbon_button.hasClass( 'disable-image' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trelated_view_controller.onSaveAndContinue();\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.SaveAndContinueBox.defaults = {};\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUwLmpzIiwibWFwcGluZ3MiOiI7QUFBQTs7QUFFQTtBQUNBLHlCQUF5QjtBQUN6QjtBQUNBOztBQUVBOztBQUVBLGdDQUFnQzs7QUFFaEM7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQSxvQkFBb0IsU0FBUzs7QUFFN0I7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTCxJQUFJOztBQUVKOztBQUVBOztBQUVBOztBQUVBLEVBQUUsR0FBRyxNQUFNIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vaW50ZXJmYWNlL2h0bWw1L2dsb2JhbC93aWRnZXRzL21lc3NhZ2VfYm94L1NhdmVBbmRDb250aW51ZUJveC5qcz8yODNmIl0sInNvdXJjZXNDb250ZW50IjpbIiggZnVuY3Rpb24oICQgKSB7XG5cblx0JC5mbi5TYXZlQW5kQ29udGludWVCb3ggPSBmdW5jdGlvbiggb3B0aW9ucyApIHtcblx0XHR2YXIgb3B0cyA9ICQuZXh0ZW5kKCB7fSwgJC5mbi5TYXZlQW5kQ29udGludWVCb3guZGVmYXVsdHMsIG9wdGlvbnMgKTtcblx0XHR2YXIgZmllbGQ7XG5cdFx0dmFyIHJlbGF0ZWRfdmlld19jb250cm9sbGVyO1xuXG5cdFx0dGhpcy5lYWNoKCBmdW5jdGlvbigpIHtcblxuXHRcdFx0dmFyIG8gPSAkLm1ldGEgPyAkLm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