updates
This commit is contained in:
+19
-23
@@ -70,34 +70,26 @@ export class Render {
|
||||
});
|
||||
}
|
||||
|
||||
if (node['hide-toolbar'] != 1) {
|
||||
if (node.title || node.descr || node?.children?.toolbar) {
|
||||
|
||||
let topBar = El('div', { className: 'top-bar' });
|
||||
const topBarInner = content.appendChild(El('div', { className: 'top-bar' }))
|
||||
.appendChild(El('div', { className: 'top-bar-inner'}) );
|
||||
|
||||
content.append(topBar);
|
||||
if (node.title || node.descr) {
|
||||
|
||||
if (node.title || node.descr || (node.children && node.children.toolbar)) {
|
||||
const titleWrapper = topBarInner.appendChild(El('div', { className: 'title-wrapper' }));
|
||||
|
||||
let topBarInner = El('div', { className: 'top-bar-inner' });
|
||||
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)) );
|
||||
}
|
||||
|
||||
topBar.append(topBarInner);
|
||||
|
||||
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' })) );
|
||||
}
|
||||
if (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);
|
||||
}
|
||||
|
||||
if (node.descr) {
|
||||
block.dataset.descr = Ut.tplString(node.descr, node.template);
|
||||
}
|
||||
|
||||
if (node.type) {
|
||||
block.dataset.type = node.type;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1020,7 +1020,7 @@
|
||||
|
||||
case 'textarea':
|
||||
|
||||
target.value = Ut.decode(val);
|
||||
target.value = Ut.unescape(val);
|
||||
|
||||
const autoexpand = domUtils.data.call(target, 'autoexpand');
|
||||
|
||||
|
||||
@@ -86,10 +86,11 @@ export class Popup {
|
||||
}, 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.target.classList.add('popup-container');
|
||||
this.card.toolbar = this.card.ui.dxFind('.top-bar-inner');
|
||||
|
||||
this.card.container.append(this.target);
|
||||
|
||||
@@ -177,35 +178,24 @@ export class Popup {
|
||||
*/
|
||||
setEvents() {
|
||||
|
||||
let that = this;
|
||||
|
||||
if (this.opts.scrollBar) {
|
||||
|
||||
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) {
|
||||
clearTimeout(tm);
|
||||
tm = null;
|
||||
}
|
||||
|
||||
tm = setTimeout(function() {
|
||||
that.resize();
|
||||
}, 300);
|
||||
tm = setTimeout(_ => t.resize(), 300);
|
||||
});
|
||||
}
|
||||
|
||||
this.card.toolbar.dxOn('click', '.ic-close', function() {
|
||||
that.destroy();
|
||||
});
|
||||
this.card.toolbar?.dxOn('click', '.ic-close', _ => this.destroy() );
|
||||
|
||||
document.dxOn('keyup.popup' + this.ekey, function(e) {
|
||||
|
||||
if (e.key == 'Escape') {
|
||||
that.destroy();
|
||||
}
|
||||
});
|
||||
document.dxOn('keyup.popup' + this.ekey, e => e.key == 'Escape' && this.destroy() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user