[BUGFIX] Fix maximum height of preview links dialog 66/50866/2
authorManuel Glauser <mail@manuelglauser.ch>
Sat, 3 Dec 2016 09:19:13 +0000 (10:19 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 3 Dec 2016 10:19:42 +0000 (11:19 +0100)
If there are many previewable languages on one page the modal dialog
now will have a scroll bar for more than 4 entries, so it doesn't
break the UI any more.

Add 'modal-inner-scroll' class to modal 'show' call to let the
JS framework handle the maximum height / scroll behavior.

Resolves: #69637
Releases: master, 7.6
Change-Id: I59f91c4364d0d611c5822492b9ace513b1a45a33
Reviewed-on: https://review.typo3.org/50866
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/workspaces/Resources/Public/JavaScript/actions.js

index 13e2ecd..de902b7 100644 (file)
@@ -21,33 +21,33 @@ TYPO3.Workspaces.Actions = {
 
        checkIntegrity: function(parameters, callbackFunction, callbackArguments) {
                TYPO3.Workspaces.ExtDirect.checkIntegrity(
-                               parameters,
-                               function (response) {
-                                       switch (response.result) {
-                                               case 'error':
-                                                       top.TYPO3.Dialog.ErrorDialog({
-                                                               minWidth: 400,
-                                                               title: 'Error',
-                                                               msg: '<div class="scope">' + TYPO3.l10n.localize('integrity.hasIssuesDescription') + '</div>'
-                                                       });
-                                                       break;
-                                               case 'warning':
-                                                       top.TYPO3.Dialog.QuestionDialog({
-                                                               minWidth: 400,
-                                                               title: 'Warning',
-                                                               msg: '<div class="scope">' + TYPO3.l10n.localize('integrity.hasIssuesDescription') + '</div>' +
-                                                                       '<div class="question">' + TYPO3.l10n.localize('integrity.hasIssuesQuestion') + '</div>',
-                                                               fn: function(result) {
-                                                                       if (result == 'yes') {
-                                                                               callbackFunction.call(this, callbackArguments)
-                                                                       }
+                       parameters,
+                       function (response) {
+                               switch (response.result) {
+                                       case 'error':
+                                               top.TYPO3.Dialog.ErrorDialog({
+                                                       minWidth: 400,
+                                                       title: 'Error',
+                                                       msg: '<div class="scope">' + TYPO3.l10n.localize('integrity.hasIssuesDescription') + '</div>'
+                                               });
+                                               break;
+                                       case 'warning':
+                                               top.TYPO3.Dialog.QuestionDialog({
+                                                       minWidth: 400,
+                                                       title: 'Warning',
+                                                       msg: '<div class="scope">' + TYPO3.l10n.localize('integrity.hasIssuesDescription') + '</div>' +
+                                                       '<div class="question">' + TYPO3.l10n.localize('integrity.hasIssuesQuestion') + '</div>',
+                                                       fn: function(result) {
+                                                               if (result == 'yes') {
+                                                                       callbackFunction.call(this, callbackArguments)
                                                                }
-                                                       });
-                                                       break;
-                                               default:
-                                                       callbackFunction.call(this, callbackArguments);
-                                       }
+                                                       }
+                                               });
+                                               break;
+                                       default:
+                                               callbackFunction.call(this, callbackArguments);
                                }
+                       }
                )
        },
 
@@ -187,13 +187,13 @@ TYPO3.Workspaces.Actions = {
                switch (TYPO3.Workspaces.Actions.currentSendToMode) {
                        case 'next':
                                TYPO3.Workspaces.ExtDirectActions.sendToNextStageExecute(parameters, TYPO3.Workspaces.Actions.handlerResponseOnExecuteAction);
-                       break;
+                               break;
                        case 'prev':
                                TYPO3.Workspaces.ExtDirectActions.sendToPrevStageExecute(parameters, TYPO3.Workspaces.Actions.handlerResponseOnExecuteAction);
-                       break;
+                               break;
                        case 'specific':
                                TYPO3.Workspaces.ExtDirectActions.sendToSpecificStageExecute(parameters, TYPO3.Workspaces.Actions.handlerResponseOnExecuteAction);
-                       break;
+                               break;
                }
 
        },
@@ -324,7 +324,7 @@ TYPO3.Workspaces.Actions = {
        updateStageChangeButtons: function (response) {
 
                if (Ext.isObject(response.error)) {
-                               TYPO3.Workspaces.Actions.handlerResponseOnExecuteAction(response);
+                       TYPO3.Workspaces.Actions.handlerResponseOnExecuteAction(response);
                } else {
                        for (componentId in response) {
                                if (response[componentId].visible) {
@@ -339,7 +339,7 @@ TYPO3.Workspaces.Actions = {
                                        }
                                }
                        }
-                               // force doLayout on each plugin containing the preview panel
+                       // force doLayout on each plugin containing the preview panel
                        Ext.getCmp('preview').plugins.each(function (item, index) {
                                if (Ext.isFunction(item.doLayout)) {
                                        item.doLayout();
@@ -387,17 +387,25 @@ TYPO3.Workspaces.Actions = {
 
                        for (language in response) {
                                var url = response[language];
-
-                               msg += String.format('<li style="margin: 0 0 8px;"><strong>{1}</strong><br /><a href="{0}" target="_blank">{0}</a></li>', url, language);
+                               msg += String.format('<li><strong>{1}</strong><br /><a href="{0}" target="_blank">{0}</a></li>', url, language);
                        }
-
                        msg += '</ul>';
 
-                       top.TYPO3.Dialog.InformationDialog({
-                               title: TYPO3.l10n.localize('previewLink'),
-                               minWidth: '400',
-                               msg: msg
-                       });
+                       top.TYPO3.Modal.show(
+                               TYPO3.l10n.localize('previewLink'),
+                               msg,
+                               Severity.info,
+                               [{
+                                       text: TYPO3.lang['ok'],
+                                       active: true,
+                                       btnClass: 'btn-info',
+                                       name: 'ok',
+                                       trigger: function() {
+                                               top.TYPO3.Modal.currentModal.trigger('modal-dismiss');
+                                       }
+                               }],
+                               ['modal-inner-scroll']
+                       );
                });
        }
-};
+};
\ No newline at end of file