[TASK] Allow AjaxDataHandler to pick button labels for Modal 67/37467/2
authorFelix Kopp <felix-source@phorax.com>
Mon, 2 Mar 2015 18:26:10 +0000 (19:26 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 2 Mar 2015 18:29:48 +0000 (19:29 +0100)
Use AjaxDataHandler with Modal API without TYPO3.Language inline.
Allow Modal API to pick button labels when wrapped in AjaxDataHandler

Resolves: #65466
Releases: master
Change-Id: Ibe1385e41a8481620af74a3af6b3c4a49485fe4f
Reviewed-on: http://review.typo3.org/37467
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Resources/Public/JavaScript/AjaxDataHandler.js

index 1fcacd9..c01d994 100644 (file)
@@ -86,14 +86,14 @@ define('TYPO3/CMS/Backend/AjaxDataHandler', ['jquery', 'TYPO3/CMS/Backend/FlashM
                        var $anchorElement = $(this);
                        TYPO3.Modal.confirm($anchorElement.data('title'), $anchorElement.data('message'), TYPO3.Severity.error, [
                                {
-                                       text: TYPO3.lang['button.cancel'],
+                                       text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Close',
                                        active: true,
                                        trigger: function() {
                                                TYPO3.Modal.dismiss();
                                        }
                                },
                                {
-                                       text: TYPO3.lang['button.delete'],
+                                       text: $(this).data('button-ok-text') || TYPO3.lang['button.delete'] || 'OK',
                                        btnClass: 'btn-danger',
                                        trigger: function() {
                                                TYPO3.Modal.dismiss();