Skip to content
Snippets Groups Projects
Commit 4eb0fcd1 authored by Sascha Wilking's avatar Sascha Wilking Committed by Anja Leichsenring
Browse files

[BUGFIX] Async broken dialog message for adding new shortcut entry

With adding a new entry to the shortcut list the new fancy dialog
window stuff will open. but your choice cannot be "respected"
because the adding action was already done before the dialog
window is open.

Resolves: #68824
Releases: master
Change-Id: I13192f08b110226a563db200209e8d7ea0b3c600
Reviewed-on: http://review.typo3.org/42349


Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent f6f1b205
No related merge requests found
......@@ -103,12 +103,27 @@ define('TYPO3/CMS/Backend/Toolbar/ShortcutMenu', ['jquery'], function($) {
* when finished it reloads the menu
*/
ShortcutMenu.createShortcut = function(moduleName, url, confirmationText, motherModule) {
var shouldCreateShortcut = true;
if (typeof confirmationText !== 'undefined') {
// @todo: translations
top.TYPO3.Modal.confirm('Create bookmark', confirmationText)
.on('confirm.button.ok', function() {
shouldCreateShortcut = true;
var $toolbarItemIcon = $(ShortcutMenu.options.toolbarIconSelector, ShortcutMenu.options.containerSelector);
var $spinner = ShortcutMenu.$spinnerElement.clone();
var $existingItem = $toolbarItemIcon.replaceWith($spinner);
$.ajax({
url: TYPO3.settings.ajaxUrls['ShortcutMenu::create'],
type: 'post',
data: {
module: moduleName,
url: url,
motherModName: motherModule
},
cache: false
}).done(function() {
ShortcutMenu.refreshMenu();
$spinner.replaceWith($existingItem);
});
$(this).trigger('modal-dismiss');
})
.on('confirm.button.cancel', function() {
......@@ -116,25 +131,6 @@ define('TYPO3/CMS/Backend/Toolbar/ShortcutMenu', ['jquery'], function($) {
});
}
if (shouldCreateShortcut) {
var $toolbarItemIcon = $(ShortcutMenu.options.toolbarIconSelector, ShortcutMenu.options.containerSelector);
var $spinner = ShortcutMenu.$spinnerElement.clone();
var $existingItem = $toolbarItemIcon.replaceWith($spinner);
$.ajax({
url: TYPO3.settings.ajaxUrls['ShortcutMenu::create'],
type: 'post',
data: {
module: moduleName,
url: url,
motherModName: motherModule
},
cache: false
}).done(function() {
ShortcutMenu.refreshMenu();
$spinner.replaceWith($existingItem);
});
}
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment