updates
This commit is contained in:
+10
-3
@@ -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
@@ -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);
|
||||
}
|
||||
@@ -531,10 +531,6 @@ export class Render {
|
||||
input.readOnly = true;
|
||||
}
|
||||
|
||||
if (field.rewrite == '1') {
|
||||
input.dataset.value = '';
|
||||
}
|
||||
|
||||
if (field.required == '1') {
|
||||
input.required = true;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user