[BUGFIX] Close extension configuration form on "Save and close" 82/44682/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 11 Nov 2015 12:12:50 +0000 (13:12 +0100)
committerMathias Schreiber <mathias.schreiber@wmdb.de>
Wed, 11 Nov 2015 12:22:11 +0000 (13:22 +0100)
Add the input field for the final action override in a pre-submit callback
to close the configuration form if a user clicks "Save and close".

Resolves: #71480
Releases: master
Change-Id: I30dcb329589f312b7cd23604078752fb4b84bc39
Reviewed-on: https://review.typo3.org/44682
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Eric Chavaillaz <eric@hemmer.ch>
Tested-by: Eric Chavaillaz <eric@hemmer.ch>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js

index 3e2d480..f5cf5a6 100644 (file)
  * ExtensionManager.Update => Various AJAX functions to display updates
  * ExtensionManager.uploadForm => helper to show the upload form
  */
-define(['jquery', 'nprogress', 'TYPO3/CMS/Backend/Modal', 'datatables', 'TYPO3/CMS/Backend/jquery.clearable'], function($, NProgress, Modal) {
+define([
+       'jquery',
+       'nprogress',
+       'TYPO3/CMS/Backend/Modal',
+       'TYPO3/CMS/Backend/SplitButtons',
+       'datatables',
+       'TYPO3/CMS/Backend/jquery.clearable'
+], function($, NProgress, Modal, SplitButtons) {
 
        /**
         *
@@ -765,8 +772,11 @@ define(['jquery', 'nprogress', 'TYPO3/CMS/Backend/Modal', 'datatables', 'TYPO3/C
                ExtensionManager.configurationFieldSupport();
                var $validate = $('.validate');
                $validate.validate();
-               $(document).on('click', '.t3js-save-close', function() {
-                       $validate.append($('<input />', {type: 'hidden', name: 'tx_extensionmanager_tools_extensionmanagerextensionmanager[action]', value: 'saveAndClose'}));
+
+               SplitButtons.addPreSubmitCallback(function(e) {
+                       if ($(e.target).hasClass('t3js-save-close')) {
+                               $validate.append($('<input />', {type: 'hidden', name: 'tx_extensionmanager_tools_extensionmanagerextensionmanager[action]', value: 'saveAndClose'}));
+                       }
                });
 
                // initialize the repository