![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-full/dist/js/ |
Upload File : |
/*** module: node_modules/absol-mobile/js/dom/MBlinkModal.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("../../css/mblinkmodal.css"); var _Core = _interopRequireDefault(require("./Core")); var _Dom = _interopRequireDefault(require("absol/src/HTML5/Dom")); var _ = _Core.default._; var $ = _Core.default.$; /*** * extends {AElement} * @constructor */ function MBlinkModal() { this.$attachhook = _('attachhook'); this.$attachhook.requestUpdateSize = this.updateSize.bind(this); this.$attachhook.addTo(this).on('error', function () { _Dom.default.addToResizeSystem(this); this.requestUpdateSize(); }); this._show = false; this.show = false; } MBlinkModal.tag = 'MBlinkModal'.toLowerCase(); MBlinkModal.render = function () { return _({ class: 'am-blink-modal' }); }; MBlinkModal.prototype.clearChild = function () { var child = Array.prototype.slice(this.childNodes); }; MBlinkModal.prototype.updateSize = function () { this.removeClass('am-animation'); var bound = this.getBoundingClientRect(); this.addStyle('--hide-top', -(bound.height + 2) + 'px'); this.addClass('am-animation'); }; MBlinkModal.property = {}; MBlinkModal.property.show = { set: function (value) { this._show = !!value; if (this._show) { this.addClass('am-show'); } else { this.removeClass('am-show'); } }, get: function () { return this._show; } }; MBlinkModal.newInstance = function (instanceData) { instanceData = instanceData || {}; instanceData.duration = instanceData.duration || 2000; var modal = _(Object.assign({ tag: 'mblinkmodal' }, instanceData || {})); var state = 0; //not attach function waitToRemove() { setTimeout(function () { if (state !== 3) return; state = 4; modal.selfRemove(); }, 300); } function waitToShow() { setTimeout(function () { if (state !== 1) return; state = 2; modal.show = true; waitToClose(instanceData.duration); }, 1); } function waitToClose(mil) { if (state === 2) { setTimeout(function () { if (state !== 2) return; state = 3; modal.show = false; waitToRemove(); }, mil); } } modal.addTo(document.body); modal.$attachhook.once('attached', function () { state = 1; //attached waitToShow(); }); return { modal: modal, close: waitToClose.bind(null, 100) }; }; _Core.default.install(MBlinkModal); var _default = MBlinkModal; exports.default = _default;