This commit is contained in:
2025-12-29 07:09:03 +02:00
parent eb3a761a71
commit d80513a8a0
22 changed files with 958 additions and 1393 deletions
+10 -3
View File
@@ -422,9 +422,16 @@ export class App extends Boot {
static destroyOldGlobalEvents() {
if (App.section) {
window.dxOff(`${App.section}*`);
document.dxOff(`${App.section}*`);
document.body.dxOff(`${App.section}*`);
Ut.each(App.widgetStack, wtList => wtList.forEach(wt => wt.destroy() ) );
App.widgetStack = {};
Ut.resetKey();
window.dxOff(`.${App.section}`);
document.dxOff(`.${App.section}`);
document.body.dxOff(`.${App.section}`);
}
// Destroy all TinyMce Instances
+10 -6
View File
@@ -26,11 +26,15 @@ export class Boot {
// Static Section Vars
static vars = {};
// Widget Stack Object
static widgetStack = {};
static ready(callback) {
dxReady(() => {
Boot.lang = document.documentElement.getAttribute('lang') ?? 'en';
Boot.isApp = document.documentElement.classList.contains('app');
import(`/js/${Boot.lang}/interface.js`).then((mod) => {
@@ -100,13 +104,13 @@ export class Boot {
EvtOptions.section = id;
}
/**
* Add Widget To Stack
*/
static addWidget = ref => Boot.isApp && (Boot.widgetStack[ref.constructor.name] ??= []).push(ref);
/**
* App Log
*/
static log(err) {
if (Boot.DEBUG) {
console.log(err);
}
}
static log = err => Boot.DEBUG && console.log(err);
}
-4
View File
@@ -531,10 +531,6 @@ export class Render {
input.readOnly = true;
}
if (field.rewrite == '1') {
input.dataset.value = '';
}
if (field.required == '1') {
input.required = true;
}
-41
View File
@@ -1,41 +0,0 @@
export class Stack {
static widgets = {};
/**
* Registers a widget instance in the global registry.
*
* @param {Object} ref - Widget instance to register.
* @returns {void}
*/
static add(ref) {
const name = ref.constructor.name;
Stack.widgets[name] ??= new Map();
// ref.ekey = crypto.randomUUID();
ref.ekey = Stack.widgets[name].size;
Stack.widgets[name].set(ref.ekey, ref);
}
/**
* Removes a widget instance from the global registry.
*
* @param {Object} ref - Widget instance to remove.
* @returns {void}
*/
static delete(ref) {
const name = ref.constructor.name;
if (!this.widgets[name]?.has(ref.ekey)) {
return;
}
this.widgets[name].delete(ref.ekey);
ref.ekey = null;
}
}