![]() 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-acomp/js/ckeditor/CKStickyToolbarController.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ACore = require("../../ACore"); var _Dom = require("absol/src/HTML5/Dom"); var _AElement = _interopRequireDefault(require("absol/src/HTML5/AElement")); function CKStickyToolbarController(holderElt) { this.editor = holderElt.editor; this.$elt = this.editor.container.$; this.activated = false; this['onScroll'] = this.onScroll.bind(this); this.trackedScroller = []; } CKStickyToolbarController.prototype.start = function () { if (this.activated) return; var c = this.$elt.parentElement; while (c) { c.addEventListener('scroll', this.onScroll); c = c.parentElement; } }; CKStickyToolbarController.prototype.stop = function () { if (!this.activated) return; while (this.trackedScroller.length > 0) { this.trackedScroller.pop().removeEventListener('scroll', this.onScroll); } }; CKStickyToolbarController.prototype.onScroll = function (event) { if (!_AElement.default.prototype.isDescendantOf.call(this.$elt, document.body)) { this.stop(); return; } this.$toolbar = this.$toolbar || (0, _ACore.$)('.cke_top', this.$elt); if (!this.$toolbar) return; var oBound = (0, _Dom.traceOutBoundingClientRect)(this.$elt.parentElement); var bound = this.$elt.getBoundingClientRect(); var tBound = this.$toolbar.getBoundingClientRect(); if (bound.top < oBound.top && oBound.top + tBound.height + 30 < bound.bottom) { this.$toolbar.addStyle('transform', 'translate(0, ' + (oBound.top - bound.top) + 'px)'); } else { this.$toolbar.removeStyle('transform'); } }; var _default = CKStickyToolbarController; exports.default = _default;