Page MenuHomePhabricator

D8961.id.diff
No OneTemporary

D8961.id.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -14,7 +14,7 @@
'differential.pkg.js' => '11a5b750',
'diffusion.pkg.css' => '3783278d',
'diffusion.pkg.js' => '5b4010f4',
- 'javelin.pkg.js' => '0452e69d',
+ 'javelin.pkg.js' => '9f6d38c7',
'maniphest.pkg.css' => 'f1887d71',
'maniphest.pkg.js' => '2fe8af22',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
@@ -208,7 +208,7 @@
'rsrc/externals/javelin/lib/Resource.js' => '356de121',
'rsrc/externals/javelin/lib/URI.js' => 'd9a9b862',
'rsrc/externals/javelin/lib/Vector.js' => '039fb90d',
- 'rsrc/externals/javelin/lib/Workflow.js' => 'f28bf201',
+ 'rsrc/externals/javelin/lib/Workflow.js' => 'ff8091f7',
'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8',
'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b',
'rsrc/externals/javelin/lib/__tests__/JSON.js' => '2295d074',
@@ -668,7 +668,7 @@
'javelin-view-interpreter' => '0c33c1a0',
'javelin-view-renderer' => '6c2b09a2',
'javelin-view-visitor' => 'efe49472',
- 'javelin-workflow' => 'f28bf201',
+ 'javelin-workflow' => 'ff8091f7',
'lightbox-attachment-css' => '7acac05d',
'maniphest-batch-editor' => '8f380ebc',
'maniphest-report-css' => '6fc16517',
@@ -1883,17 +1883,6 @@
4 => 'javelin-request',
5 => 'javelin-workflow',
),
- 'f28bf201' =>
- array(
- 0 => 'javelin-stratcom',
- 1 => 'javelin-request',
- 2 => 'javelin-dom',
- 3 => 'javelin-vector',
- 4 => 'javelin-install',
- 5 => 'javelin-util',
- 6 => 'javelin-mask',
- 7 => 'javelin-uri',
- ),
'f42bb8c6' =>
array(
0 => 'javelin-stratcom',
@@ -1985,6 +1974,17 @@
2 => 'javelin-workflow',
3 => 'javelin-dom',
),
+ 'ff8091f7' =>
+ array(
+ 0 => 'javelin-stratcom',
+ 1 => 'javelin-request',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-vector',
+ 4 => 'javelin-install',
+ 5 => 'javelin-util',
+ 6 => 'javelin-mask',
+ 7 => 'javelin-uri',
+ ),
28497740 =>
array(
0 => 'javelin-behavior',
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
@@ -107,26 +107,39 @@
JX.Workflow._pop();
} else {
var form = event.getNode('jx-dialog');
+ JX.Workflow._dosubmit(form, t);
+ }
+ },
+ _onsyntheticsubmit : function(e) {
+ if (JX.Stratcom.pass()) {
+ return;
+ }
+ if (JX.Workflow._disabled) {
+ return;
+ }
+ e.prevent();
+ var form = e.getNode('jx-dialog');
+ var button = JX.DOM.find(form, 'button', '__default__');
+ JX.Workflow._dosubmit(form, button);
+ },
+ _dosubmit : function(form, button) {
+ // Issue a DOM event first, so form-oriented handlers can act.
+ var dom_event = JX.DOM.invoke(form, 'didWorkflowSubmit');
+ if (dom_event.getPrevented()) {
+ return;
+ }
- // Issue a DOM event first, so form-oriented handlers can act.
- var dom_event = JX.DOM.invoke(form, 'didWorkflowSubmit');
- if (dom_event.getPrevented()) {
- return;
- }
-
- var data = JX.DOM.convertFormToListOfPairs(form);
-
- data.push([t.name, t.value || true]);
+ var data = JX.DOM.convertFormToListOfPairs(form);
+ data.push([button.name, button.value || true]);
- var active = JX.Workflow._getActiveWorkflow();
- var e = active.invoke('submit', {form: form, data: data});
- if (!e.getStopped()) {
- active._destroy();
- active
- .setURI(form.getAttribute('action') || active.getURI())
- .setDataWithListOfPairs(data)
- .start();
- }
+ var active = JX.Workflow._getActiveWorkflow();
+ var e = active.invoke('submit', {form: form, data: data});
+ if (!e.getStopped()) {
+ active._destroy();
+ active
+ .setURI(form.getAttribute('action') || active.getURI())
+ .setDataWithListOfPairs(data)
+ .start();
}
},
_getActiveWorkflow : function() {
@@ -155,6 +168,11 @@
'click',
[['jx-workflow-button'], ['tag:button']],
JX.Workflow._onbutton);
+ JX.DOM.listen(
+ this._root,
+ 'didSyntheticSubmit',
+ [],
+ JX.Workflow._onsyntheticsubmit);
document.body.appendChild(this._root);
var d = JX.Vector.getDim(this._root);
var v = JX.Vector.getViewport();

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 2:38 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6724122
Default Alt Text
D8961.id.diff (4 KB)

Event Timeline