Page MenuHomePhorge

D25076.1737281542.diff
No OneTemporary

D25076.1737281542.diff

diff --git a/webroot/rsrc/externals/javelin/lib/Workflow.js b/webroot/rsrc/externals/javelin/lib/Workflow.js
--- a/webroot/rsrc/externals/javelin/lib/Workflow.js
+++ b/webroot/rsrc/externals/javelin/lib/Workflow.js
@@ -404,14 +404,18 @@
}
}
- var form = JX.DOM.scry(this._root, 'form', 'jx-dialog');
- if (form.length) {
- JX.DOM.listen(form[0], 'keydown', null, function(e) {
- if (e.getSpecialKey()) {
- return;
- }
- JX.Stratcom.addSigil(form[0], 'dialog-keydown');
- });
+ // Only when the response is a Dialog, check if the user
+ // is quitting with pending changes
+ if (this._root) {
+ var form = JX.DOM.scry(this._root, 'form', 'jx-dialog');
+ if (form.length) {
+ JX.DOM.listen(form[0], 'keydown', null, function(e) {
+ if (e.getSpecialKey()) {
+ return;
+ }
+ JX.Stratcom.addSigil(form[0], 'dialog-keydown');
+ });
+ }
}
},
_push : function() {
@@ -546,13 +550,20 @@
return;
}
- var form = JX.DOM.scry(active._root, 'form', 'jx-dialog');
- if (
- form.length &&
- JX.Stratcom.hasSigil(form[0], 'dialog-keydown') &&
- !confirm('Form data may have changed. Are you sure you want to close this dialog?')
- ) {
- return;
+ // Only when the response is a Dialog, check if the user
+ // is quitting with pending changes
+ if (active._root) {
+ var form = JX.DOM.scry(active._root, 'form', 'jx-dialog');
+ var confirmMsg =
+ 'Form data may have changed. ' +
+ 'Are you sure you want to close this dialog?';
+ if (
+ form.length &&
+ JX.Stratcom.hasSigil(form[0], 'dialog-keydown') &&
+ !window.confirm(confirmMsg)
+ ) {
+ return;
+ }
}
JX.Workflow._pop();

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 10:12 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1133379
Default Alt Text
D25076.1737281542.diff (1 KB)

Event Timeline