updates
This commit is contained in:
+21
-25
@@ -69,35 +69,27 @@ export class Render {
|
|||||||
content?.dxFind('[data-group]:not(.hide)')?.dxFadeOut(_ => content?.dxFind('[data-group="'+ t.dataset.id +'"]')?.dxFadeIn());
|
content?.dxFind('[data-group]:not(.hide)')?.dxFadeOut(_ => content?.dxFind('[data-group="'+ t.dataset.id +'"]')?.dxFadeIn());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.title || node.descr || node?.children?.toolbar) {
|
||||||
|
|
||||||
if (node['hide-toolbar'] != 1) {
|
const topBarInner = content.appendChild(El('div', { className: 'top-bar' }))
|
||||||
|
.appendChild(El('div', { className: 'top-bar-inner'}) );
|
||||||
|
|
||||||
let topBar = El('div', { className: 'top-bar' });
|
if (node.title || node.descr) {
|
||||||
|
|
||||||
|
const titleWrapper = topBarInner.appendChild(El('div', { className: 'title-wrapper' }));
|
||||||
|
|
||||||
content.append(topBar);
|
node.title && titleWrapper.append( El('h2', { className: 'title' }, Ut.tplString(node.title, node.template) ));
|
||||||
|
node.descr && titleWrapper.append( El('p', { className: 'descr' }, Ut.tplString(node.descr, node.template)) );
|
||||||
|
}
|
||||||
|
|
||||||
if (node.title || node.descr || (node.children && node.children.toolbar)) {
|
if (node?.children?.toolbar) {
|
||||||
|
Render.makeUiElements(
|
||||||
let topBarInner = El('div', { className: 'top-bar-inner' });
|
Ut.objVal(node.children.toolbar).children,
|
||||||
|
topBarInner.appendChild(
|
||||||
topBar.append(topBarInner);
|
El('div', { className: 'ml10 flex v-center no-shrink' })
|
||||||
|
)
|
||||||
if (node.title || node.descr) {
|
);
|
||||||
|
|
||||||
let titleWrapper = topBarInner.appendChild(El('div', { className: 'title-wrapper' }));
|
|
||||||
|
|
||||||
if (node.title) {
|
|
||||||
titleWrapper.append( El('h2', { className: 'title' }, Ut.tplString(node.title, node.template) ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.descr) {
|
|
||||||
titleWrapper.append( El('p', { className: 'descr' }, Ut.tplString(node.descr, node.template)) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.children && node.children.toolbar) {
|
|
||||||
Render.makeUiElements(Ut.objVal(node.children.toolbar).children, topBarInner.appendChild(El('div', { className: 'ml10 flex v-center no-shrink' })) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +129,10 @@ export class Render {
|
|||||||
block.dataset.title = Ut.tplString(node.title, node.template);
|
block.dataset.title = Ut.tplString(node.title, node.template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.descr) {
|
||||||
|
block.dataset.descr = Ut.tplString(node.descr, node.template);
|
||||||
|
}
|
||||||
|
|
||||||
if (node.type) {
|
if (node.type) {
|
||||||
block.dataset.type = node.type;
|
block.dataset.type = node.type;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1020,7 +1020,7 @@
|
|||||||
|
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
|
|
||||||
target.value = Ut.decode(val);
|
target.value = Ut.unescape(val);
|
||||||
|
|
||||||
const autoexpand = domUtils.data.call(target, 'autoexpand');
|
const autoexpand = domUtils.data.call(target, 'autoexpand');
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,11 @@ export class Popup {
|
|||||||
}, null)
|
}, null)
|
||||||
};
|
};
|
||||||
|
|
||||||
this.card.toolbar = this.card.ui.dxFind('.top-bar-inner');
|
this.target.classList.add('popup-container');
|
||||||
|
|
||||||
this.card.container = this.card.ui.dxFind('.container');
|
this.card.container = this.card.ui.dxFind('.container');
|
||||||
|
|
||||||
this.target.classList.add('popup-container');
|
this.card.toolbar = this.card.ui.dxFind('.top-bar-inner');
|
||||||
|
|
||||||
this.card.container.append(this.target);
|
this.card.container.append(this.target);
|
||||||
|
|
||||||
@@ -177,35 +178,24 @@ export class Popup {
|
|||||||
*/
|
*/
|
||||||
setEvents() {
|
setEvents() {
|
||||||
|
|
||||||
let that = this;
|
|
||||||
|
|
||||||
if (this.opts.scrollBar) {
|
if (this.opts.scrollBar) {
|
||||||
|
|
||||||
let tm = null;
|
let tm = null;
|
||||||
|
|
||||||
window.dxOn('resize.popup' + this.ekey + ' orientationchange.popup' + this.ekey, function() {
|
window.dxOn('resize.popup' + this.ekey + ' orientationchange.popup' + this.ekey, (_, t) => {
|
||||||
|
|
||||||
if (tm) {
|
if (tm) {
|
||||||
clearTimeout(tm);
|
clearTimeout(tm);
|
||||||
tm = null;
|
tm = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
tm = setTimeout(function() {
|
tm = setTimeout(_ => t.resize(), 300);
|
||||||
that.resize();
|
|
||||||
}, 300);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.card.toolbar.dxOn('click', '.ic-close', function() {
|
this.card.toolbar?.dxOn('click', '.ic-close', _ => this.destroy() );
|
||||||
that.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.dxOn('keyup.popup' + this.ekey, function(e) {
|
document.dxOn('keyup.popup' + this.ekey, e => e.key == 'Escape' && this.destroy() );
|
||||||
|
|
||||||
if (e.key == 'Escape') {
|
|
||||||
that.destroy();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user