@iebh/tera-fy 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/lib/terafy.server.js +16 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/terafy.server.js
CHANGED
|
@@ -1570,8 +1570,8 @@ export default class TeraFyServer {
|
|
|
1570
1570
|
uiProgress(options) {
|
|
1571
1571
|
if (options === false) options = {close: true}; // Shorthand to close existing ui progress window
|
|
1572
1572
|
|
|
1573
|
-
if (this.
|
|
1574
|
-
this.
|
|
1573
|
+
if (!options?.close && this._uiProgress.options === null) { // Create new uiProgress options object
|
|
1574
|
+
this._uiProgress.options = reactive({
|
|
1575
1575
|
body: '',
|
|
1576
1576
|
bodyHtml: false,
|
|
1577
1577
|
title: 'TERA',
|
|
@@ -1581,23 +1581,23 @@ export default class TeraFyServer {
|
|
|
1581
1581
|
...options,
|
|
1582
1582
|
});
|
|
1583
1583
|
} else { // Merge options with existing uiProgress window
|
|
1584
|
-
Object.assign(this.
|
|
1584
|
+
Object.assign(this._uiProgress.options, options);
|
|
1585
1585
|
}
|
|
1586
1586
|
|
|
1587
|
-
if (this.
|
|
1587
|
+
if (this._uiProgress.options.close) { // Asked to close the dialog
|
|
1588
1588
|
return Promise.resolve()
|
|
1589
|
-
.then(()=> this.
|
|
1589
|
+
.then(()=> this._uiProgress.promise && app.service('$prompt').close(true)) // Close the dialog if its open
|
|
1590
1590
|
.then(()=> { // Release state
|
|
1591
|
-
this.
|
|
1592
|
-
this.
|
|
1591
|
+
this._uiProgress.options = {};
|
|
1592
|
+
this._uiProgress.promise = null;
|
|
1593
1593
|
})
|
|
1594
|
-
} else if (!this.
|
|
1595
|
-
this.
|
|
1594
|
+
} else if (!this._uiProgress.promise) { // Not created the dialog yet
|
|
1595
|
+
this._uiProgress.promise = this.requestFocus(()=>
|
|
1596
1596
|
app.service('$prompt').dialog({
|
|
1597
|
-
title: this.
|
|
1598
|
-
backdrop: this.
|
|
1597
|
+
title: this._uiProgress.options.title,
|
|
1598
|
+
backdrop: this._uiProgress.options.backdrop, // pass backdrop to allow 'static' dialog
|
|
1599
1599
|
component: 'uiProgress',
|
|
1600
|
-
componentProps: this.
|
|
1600
|
+
componentProps: this._uiProgress.options,
|
|
1601
1601
|
closeable: false,
|
|
1602
1602
|
keyboard: false,
|
|
1603
1603
|
})
|
|
@@ -1608,8 +1608,10 @@ export default class TeraFyServer {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
}
|
|
1610
1610
|
|
|
1611
|
-
|
|
1612
|
-
|
|
1611
|
+
_uiProgress = {
|
|
1612
|
+
options: {},
|
|
1613
|
+
promise: null,
|
|
1614
|
+
};
|
|
1613
1615
|
|
|
1614
1616
|
|
|
1615
1617
|
/**
|
package/package.json
CHANGED