[BUGFIX] Determine default severity for modals correctly 56/52356/5
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 4 Apr 2017 09:15:36 +0000 (11:15 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 5 Apr 2017 13:21:39 +0000 (15:21 +0200)
This patch fixes the determination of the default severity for modals.
This ensures that the modal's header and its default button receive
the same coloring.

Resolves: #80677
Related: #80579
Releases: master
Change-Id: I7bfc5bff21a28318b2fea03f5fe534264e47cbb0
Reviewed-on: https://review.typo3.org/52356
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/Modal.js

index e684ece..66172cf 100644 (file)
@@ -141,11 +141,13 @@ define(['jquery',
         * @param {array} [additionalCssClasses=''] additional css classes to add to the modal
         */
        Modal.confirm = function(title, content, severity, buttons, additionalCssClasses) {
+               severity = typeof severity !== 'undefined' ? severity : Severity.warning;
+
                return Modal.advanced(
                        {
                                title: title,
                                content: content,
-                               severity: typeof severity !== 'undefined' ? severity : Severity.warning,
+                               severity: severity,
                                buttons: buttons || [
                                        {
                                                text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',