[BUGFIX] SplitButtons.js must take CMD of BaseScriptClass into consideration 60/43960/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 10 Oct 2015 06:23:05 +0000 (08:23 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 10 Oct 2015 10:02:03 +0000 (12:02 +0200)
Modules may use the CMD attribute of BaseScriptClass to handle the save
actions. Adjust the selectors of SplitButtons.js to take these links
into consideration.

Resolves: #70562
Related: #70531
Releases: master
Change-Id: I06bce96e894080ca4a9bd36a761be588ec46e56c
Reviewed-on: http://review.typo3.org/43960
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/SplitButtons.js

index 6781d1a..82c6bca 100644 (file)
@@ -25,7 +25,13 @@ define('TYPO3/CMS/Backend/SplitButtons', ['jquery'], function($) {
         * Initializes the save handling
         */
        SplitButtons.initializeSaveHandling = function() {
-               $(document).on('click', 'button[name^="_save"], a[data-name^="_save"]', function(e) {
+               var elements = [
+                       'button[name^="_save"]',
+                       'a[data-name^="_save"]',
+                       'button[name="CMD"][value^="save"]',
+                       'a[data-name="CMD"][data-value^="save"]'
+               ].join(',');
+               $(document).on('click', elements, function(e) {
                        var $me = $(this),
                                $form = $me.closest('form'),
                                name = $me.data('name') || this.name,