mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 15:21:03 +01:00
Prevent double-submit with control + enter
Summary: Fixes T2833. Lock forms and prevent double submit on control + enter. Test Plan: Mashed control + enter a whole bunch in Maniphest, got one comment instead of several. Reviewers: btrahan, edward Reviewed By: btrahan CC: aran Maniphest Tasks: T2833 Differential Revision: https://secure.phabricator.com/D5473
This commit is contained in:
parent
1196675697
commit
5e57ac0e9f
3 changed files with 47 additions and 40 deletions
|
@ -1161,7 +1161,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-aphront-form-disable-on-submit' =>
|
||||
array(
|
||||
'uri' => '/res/b5052cd0/rsrc/js/application/core/behavior-form.js',
|
||||
'uri' => '/res/f5a60aec/rsrc/js/application/core/behavior-form.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -3455,7 +3455,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phrequent-css' =>
|
||||
array(
|
||||
'uri' => '/res/8fc8f63c/rsrc/css/application/phrequent/phrequent.css',
|
||||
'uri' => '/res/9d6f3eb7/rsrc/css/application/phrequent/phrequent.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -3807,7 +3807,7 @@ celerity_register_resource_map(array(
|
|||
'uri' => '/res/pkg/4fc2a8f9/core.pkg.css',
|
||||
'type' => 'css',
|
||||
),
|
||||
'95ceba95' =>
|
||||
'def4c982' =>
|
||||
array(
|
||||
'name' => 'core.pkg.js',
|
||||
'symbols' =>
|
||||
|
@ -3848,7 +3848,7 @@ celerity_register_resource_map(array(
|
|||
33 => 'javelin-behavior-global-drag-and-drop',
|
||||
34 => 'javelin-behavior-phabricator-reveal-content',
|
||||
),
|
||||
'uri' => '/res/pkg/95ceba95/core.pkg.js',
|
||||
'uri' => '/res/pkg/def4c982/core.pkg.js',
|
||||
'type' => 'js',
|
||||
),
|
||||
'dca4a03d' =>
|
||||
|
@ -4020,17 +4020,17 @@ celerity_register_resource_map(array(
|
|||
'diffusion-icons-css' => 'c8ce2d88',
|
||||
'global-drag-and-drop-css' => '4fc2a8f9',
|
||||
'inline-comment-summary-css' => '8aaacd1b',
|
||||
'javelin-aphlict' => '95ceba95',
|
||||
'javelin-aphlict' => 'def4c982',
|
||||
'javelin-behavior' => 'fe22443b',
|
||||
'javelin-behavior-aphlict-dropdown' => '95ceba95',
|
||||
'javelin-behavior-aphlict-listen' => '95ceba95',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => '95ceba95',
|
||||
'javelin-behavior-aphlict-dropdown' => 'def4c982',
|
||||
'javelin-behavior-aphlict-listen' => 'def4c982',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => 'def4c982',
|
||||
'javelin-behavior-aphront-drag-and-drop' => '322728f3',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => '322728f3',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => '95ceba95',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => 'def4c982',
|
||||
'javelin-behavior-audit-preview' => 'f96657b8',
|
||||
'javelin-behavior-dark-console' => 'dca4a03d',
|
||||
'javelin-behavior-device' => '95ceba95',
|
||||
'javelin-behavior-device' => 'def4c982',
|
||||
'javelin-behavior-differential-accept-with-errors' => '322728f3',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => '322728f3',
|
||||
'javelin-behavior-differential-comment-jump' => '322728f3',
|
||||
|
@ -4046,32 +4046,32 @@ celerity_register_resource_map(array(
|
|||
'javelin-behavior-diffusion-commit-graph' => 'f96657b8',
|
||||
'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8',
|
||||
'javelin-behavior-error-log' => 'dca4a03d',
|
||||
'javelin-behavior-global-drag-and-drop' => '95ceba95',
|
||||
'javelin-behavior-history-install' => '95ceba95',
|
||||
'javelin-behavior-konami' => '95ceba95',
|
||||
'javelin-behavior-lightbox-attachments' => '95ceba95',
|
||||
'javelin-behavior-global-drag-and-drop' => 'def4c982',
|
||||
'javelin-behavior-history-install' => 'def4c982',
|
||||
'javelin-behavior-konami' => 'def4c982',
|
||||
'javelin-behavior-lightbox-attachments' => 'def4c982',
|
||||
'javelin-behavior-load-blame' => '322728f3',
|
||||
'javelin-behavior-maniphest-batch-selector' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-subpriority-editor' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-controls' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-expand' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-preview' => 'f85eb6d8',
|
||||
'javelin-behavior-phabricator-active-nav' => '95ceba95',
|
||||
'javelin-behavior-phabricator-autofocus' => '95ceba95',
|
||||
'javelin-behavior-phabricator-gesture' => '95ceba95',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '95ceba95',
|
||||
'javelin-behavior-phabricator-nav' => '95ceba95',
|
||||
'javelin-behavior-phabricator-active-nav' => 'def4c982',
|
||||
'javelin-behavior-phabricator-autofocus' => 'def4c982',
|
||||
'javelin-behavior-phabricator-gesture' => 'def4c982',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => 'def4c982',
|
||||
'javelin-behavior-phabricator-nav' => 'def4c982',
|
||||
'javelin-behavior-phabricator-object-selector' => '322728f3',
|
||||
'javelin-behavior-phabricator-oncopy' => '95ceba95',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => '95ceba95',
|
||||
'javelin-behavior-phabricator-reveal-content' => '95ceba95',
|
||||
'javelin-behavior-phabricator-search-typeahead' => '95ceba95',
|
||||
'javelin-behavior-phabricator-tooltips' => '95ceba95',
|
||||
'javelin-behavior-phabricator-watch-anchor' => '95ceba95',
|
||||
'javelin-behavior-refresh-csrf' => '95ceba95',
|
||||
'javelin-behavior-phabricator-oncopy' => 'def4c982',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => 'def4c982',
|
||||
'javelin-behavior-phabricator-reveal-content' => 'def4c982',
|
||||
'javelin-behavior-phabricator-search-typeahead' => 'def4c982',
|
||||
'javelin-behavior-phabricator-tooltips' => 'def4c982',
|
||||
'javelin-behavior-phabricator-watch-anchor' => 'def4c982',
|
||||
'javelin-behavior-refresh-csrf' => 'def4c982',
|
||||
'javelin-behavior-repository-crossreference' => '322728f3',
|
||||
'javelin-behavior-toggle-class' => '95ceba95',
|
||||
'javelin-behavior-workflow' => '95ceba95',
|
||||
'javelin-behavior-toggle-class' => 'def4c982',
|
||||
'javelin-behavior-workflow' => 'def4c982',
|
||||
'javelin-dom' => 'fe22443b',
|
||||
'javelin-event' => 'fe22443b',
|
||||
'javelin-install' => 'fe22443b',
|
||||
|
@ -4093,39 +4093,39 @@ celerity_register_resource_map(array(
|
|||
'lightbox-attachment-css' => '4fc2a8f9',
|
||||
'maniphest-task-summary-css' => '6b1fccc6',
|
||||
'maniphest-transaction-detail-css' => '6b1fccc6',
|
||||
'phabricator-busy' => '95ceba95',
|
||||
'phabricator-busy' => 'def4c982',
|
||||
'phabricator-content-source-view-css' => '8aaacd1b',
|
||||
'phabricator-core-buttons-css' => '4fc2a8f9',
|
||||
'phabricator-core-css' => '4fc2a8f9',
|
||||
'phabricator-crumbs-view-css' => '4fc2a8f9',
|
||||
'phabricator-directory-css' => '4fc2a8f9',
|
||||
'phabricator-drag-and-drop-file-upload' => '322728f3',
|
||||
'phabricator-dropdown-menu' => '95ceba95',
|
||||
'phabricator-file-upload' => '95ceba95',
|
||||
'phabricator-dropdown-menu' => 'def4c982',
|
||||
'phabricator-file-upload' => 'def4c982',
|
||||
'phabricator-filetree-view-css' => '4fc2a8f9',
|
||||
'phabricator-flag-css' => '4fc2a8f9',
|
||||
'phabricator-form-view-css' => '4fc2a8f9',
|
||||
'phabricator-header-view-css' => '4fc2a8f9',
|
||||
'phabricator-jump-nav' => '4fc2a8f9',
|
||||
'phabricator-keyboard-shortcut' => '95ceba95',
|
||||
'phabricator-keyboard-shortcut-manager' => '95ceba95',
|
||||
'phabricator-keyboard-shortcut' => 'def4c982',
|
||||
'phabricator-keyboard-shortcut-manager' => 'def4c982',
|
||||
'phabricator-main-menu-view' => '4fc2a8f9',
|
||||
'phabricator-menu-item' => '95ceba95',
|
||||
'phabricator-menu-item' => 'def4c982',
|
||||
'phabricator-nav-view-css' => '4fc2a8f9',
|
||||
'phabricator-notification' => '95ceba95',
|
||||
'phabricator-notification' => 'def4c982',
|
||||
'phabricator-notification-css' => '4fc2a8f9',
|
||||
'phabricator-notification-menu-css' => '4fc2a8f9',
|
||||
'phabricator-object-item-list-view-css' => '4fc2a8f9',
|
||||
'phabricator-object-selector-css' => '8aaacd1b',
|
||||
'phabricator-paste-file-upload' => '95ceba95',
|
||||
'phabricator-prefab' => '95ceba95',
|
||||
'phabricator-paste-file-upload' => 'def4c982',
|
||||
'phabricator-prefab' => 'def4c982',
|
||||
'phabricator-project-tag-css' => '6b1fccc6',
|
||||
'phabricator-remarkup-css' => '4fc2a8f9',
|
||||
'phabricator-shaped-request' => '322728f3',
|
||||
'phabricator-side-menu-view-css' => '4fc2a8f9',
|
||||
'phabricator-standard-page-view' => '4fc2a8f9',
|
||||
'phabricator-textareautils' => '95ceba95',
|
||||
'phabricator-tooltip' => '95ceba95',
|
||||
'phabricator-textareautils' => 'def4c982',
|
||||
'phabricator-tooltip' => 'def4c982',
|
||||
'phabricator-transaction-view-css' => '4fc2a8f9',
|
||||
'phabricator-zindex-css' => '4fc2a8f9',
|
||||
'sprite-apps-large-css' => '4fc2a8f9',
|
||||
|
|
|
@ -3249,7 +3249,7 @@ phutil_register_library_map(array(
|
|||
'PhrequentController' => 'PhabricatorController',
|
||||
'PhrequentDAO' => 'PhabricatorLiskDAO',
|
||||
'PhrequentListController' => 'PhrequentController',
|
||||
'PhrequentTrackController' => 'PhabricatorApplicationsController',
|
||||
'PhrequentTrackController' => 'PhrequentController',
|
||||
'PhrequentUIEventListener' => 'PhutilEventListener',
|
||||
'PhrequentUserTime' => 'PhrequentDAO',
|
||||
'PhrequentUserTimeQuery' => 'PhabricatorOffsetPagedQuery',
|
||||
|
|
|
@ -31,6 +31,13 @@ JX.behavior('aphront-form-disable-on-submit', function(config) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Don't double-submit forms.
|
||||
if (form._disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
will_submit(form);
|
||||
|
||||
// If nothing handled the synthetic submit, submit normally.
|
||||
form.submit();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue