![]() 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-vchart/src/vchart.resizablediv.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ACore = _interopRequireDefault(require("absol-acomp/ACore")); var _EventEmitter = _interopRequireDefault(require("absol/src/HTML5/EventEmitter")); var _ = _ACore.default._; var $ = _ACore.default.$; function ResizeableDiv() { this.$resizebox = $('resizebox', this).on('beginmove', this.eventHandler.beginMove); this.on('click', this.eventHandler.click); } ResizeableDiv.tag = 'ResizeableDiv'.toLowerCase(); ResizeableDiv.render = function () { return _({ class: ['vchart-resizable-div'], extendEvent: 'sizechange', child: { tag: 'resizebox', props: { canResize: true } } }); }; _ACore.default.install('resizablediv', ResizeableDiv); ResizeableDiv.eventHandler = {}; ResizeableDiv.eventHandler.click = function () { this.enableResize(); }; ResizeableDiv.eventHandler.clickBody = function (event) { if (_EventEmitter.default.hitElement(this.$modal, event) || _EventEmitter.default.hitElement(this, event)) return; this.disableResize(); }; ResizeableDiv.eventHandler.beginMove = function (event) { this.$modal = (this.$modal || _({ style: { position: 'fixed', left: '1px', right: '1px', top: '1px', bottom: '1px', zIndex: '1000' } })).addTo(document.body); this.$resizebox.on('moving', this.eventHandler.moving); this.$resizebox.on('endmove', this.eventHandler.endMove); this._preBound = this.getBoundingClientRect(); }; ResizeableDiv.eventHandler.moving = function (event) { var w = this._preBound.width; var h = this._preBound.height; if (event.option.bottom) { h += event.clientDY; this.addStyle('height', this._preBound.height + event.clientDY + 'px'); } if (event.option.right) { w += event.clientDX; this.addStyle('width', this._preBound.width + event.clientDX + 'px'); } this.emit('sizechange', { type: 'type', target: this, width: w, height: h, originEvent: event.originEvent || event }); }; ResizeableDiv.eventHandler.endMove = function (event) { this.$resizebox.off('moving', this.eventHandler.moving); this.$resizebox.off('endmove', this.eventHandler.endMove); this.$modal.remove(); }; ResizeableDiv.prototype.enableResize = function () { if (this.containsClass('vchart-resizable-div-active')) return; this.addClass('vchart-resizable-div-active'); $(document.body).on('click', this.eventHandler.clickBody); }; ResizeableDiv.prototype.disableResize = function () { if (!this.containsClass('vchart-resizable-div-active')) return; this.removeClass('vchart-resizable-div-active'); $(document.body).off('click', this.eventHandler.clickBody); }; var _default = ResizeableDiv; exports.default = _default;