![]() 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-form/js/core/ |
Upload File : |
import ScalableComponent from "./ScalableComponent"; import inheritComponentClass from "./inheritComponentClass"; function BaseLayout() { ScalableComponent.call(this); } inheritComponentClass(BaseLayout, ScalableComponent); BaseLayout.prototype.isLayout = true; BaseLayout.prototype.styleHandlers.backgroundImage = { set: function (value) { if (value && value.length > 0) { this.domElt.addStyle('backgroundImage', 'url(' + value + ')'); this.domElt.addStyle('backgroundSize', '100% 100%'); } else { this.domElt.removeStyle('backgroundImage'); this.domElt.removeStyle('backgroundSize'); } return value; }, export: function (ref) { return ref.get() || undefined; }, descriptor: { type: 'text', long: true, sign: 'BackgroundImageSrc', independence: true } }; BaseLayout.prototype.styleHandlers.backgroundColor = { set: function (value) { if (value) { this.domElt.addStyle('backgroundColor', value); } else { this.domElt.removeStyle('backgroundColor'); } return value; }, descriptor: { type: 'color', sign: 'BackgroundColor', independence: true } }; BaseLayout.prototype.create = function () { ScalableComponent.prototype.create.call(this); this.style.vAlign = 'fixed'; this.style.hAlign = 'fixed'; this.style.backgroundColor = 'rgba(0, 0, 0, 0)'; this.style.backgroundImage = ''; }; BaseLayout.prototype.addChildByPosition = function (child, posX, posY) { throw new Error("Not implement!"); }; BaseLayout.prototype.getAcceptsStyleNames = function () { return ScalableComponent.prototype.getAcceptsStyleNames.call(this).concat(['backgroundColor', 'backgroundImage']); }; BaseLayout.prototype.bindDataToFragment = function (parentDisembark, reset) { if (!this.fragment) return; if (!this.fragment.parent) return; /*** * * @type {FmFragment} */ var parentFragment = this.fragment.parent; var fragment = this.fragment; var name = this.attributes.name; if (!name) return; var boundProp = parentFragment.boundProps[name]; if (!reset && boundProp === this) return; var descriptor = { set: function (obj) { fragment.props = obj; }, get: function () { return fragment.props; } }; if (!this.attributes.dataBinding) return; var obj = parentFragment.props; Object.assign(descriptor, { enumerable: !this.attributes.disembark && !parentDisembark, configurable: true }); Object.defineProperty(obj, name, descriptor); this.fragment.boundProps[name] = this; }; BaseLayout.prototype.unbindDataInFragment = function () { if (!this.fragment) return; if (!this.fragment.parent) return; var name = this.attributes.name; if (!name) return; /*** * * @type {FmFragment} */ var parentFragment = this.fragment.parent; var boundProp = parentFragment.boundProps[name]; if (boundProp !== this) return; var obj = parentFragment.props; delete obj[name]; delete parentFragment.boundProps[name]; }; export default BaseLayout;