Commit 318bcc79 authored by Frank Nägler's avatar Frank Nägler Committed by Christian Kuhn
Browse files

[TASK] Replace confirm for delete shortcut

Resolves: #68238
Releases: master
Change-Id: Iddcc5a7cb29c929377c414441585be5b46e6dacb
Reviewed-on: http://review.typo3.org/41482

Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 5553023a
......@@ -76,21 +76,26 @@ define('TYPO3/CMS/Backend/Toolbar/ShortcutMenu', ['jquery'], function($) {
*/
ShortcutMenu.deleteShortcut = function($shortcutRecord) {
// @todo: translations
if (confirm('Do you really want to remove this bookmark?')) {
$.ajax({
url: TYPO3.settings.ajaxUrls['ShortcutMenu::delete'],
data: {
shortcutId: $shortcutRecord.data('shortcutid')
},
type: 'post',
cache: false
}).done(function() {
// a reload is used in order to restore the original behaviour
// e.g. remove groups that are now empty because the last one in the group
// was removed
ShortcutMenu.refreshMenu();
top.TYPO3.Modal.confirm('Delete bookmark', 'Do you really want to remove this bookmark?')
.on('confirm.button.ok', function() {
$.ajax({
url: TYPO3.settings.ajaxUrls['ShortcutMenu::delete'],
data: {
shortcutId: $shortcutRecord.data('shortcutid')
},
type: 'post',
cache: false
}).done(function() {
// a reload is used in order to restore the original behaviour
// e.g. remove groups that are now empty because the last one in the group
// was removed
ShortcutMenu.refreshMenu();
});
$(this).trigger('modal-dismiss');
})
.on('confirm.button.cancel', function() {
$(this).trigger('modal-dismiss');
});
}
};
/**
......@@ -167,4 +172,4 @@ define('TYPO3/CMS/Backend/Toolbar/ShortcutMenu', ['jquery'], function($) {
TYPO3.ShortcutMenu = ShortcutMenu;
return ShortcutMenu;
}();
});
\ No newline at end of file
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment