MINOR Custom confirm message for deleting folders in AssetAdmin

This commit is contained in:
Ingo Schommer 2012-02-23 17:32:00 +01:00
parent c582f08ea3
commit 7574c3177d
2 changed files with 17 additions and 2 deletions

View File

@ -24,8 +24,15 @@
$.entwine('ss', function($){
/**
* Load folder detail view via controller methods
* rather than built-in GridField view (which is only geared towards showing files).
*/
$('#Form_EditForm_File .ss-gridfield-item').entwine({
onclick: function(e) {
// Let actions do their own thing
if($(e.target).is('.action')) return;
var grid = this.closest('.ss-gridfield');
if(this.data('class') == 'Folder') {
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
@ -34,7 +41,14 @@
}
}
});
$('.cms-edit-form :submit[name=action_delete]').entwine({
onclick: function(e) {
if(!confirm(ss.i18n._t('AssetAdmin.ConfirmDelete'))) return false;
else this._super(e);
}
});
/**
* Class: #Form_SyncForm
*/

View File

@ -34,6 +34,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'AssetTableField.MOVING': 'Moving %s file(s)',
'SecurityAdmin.BATCHACTIONSDELETECONFIRM': "Do you really want to delete %s groups?",
'CMSMAIN.AddSearchCriteria': 'Add Criteria',
'WidgetAreaEditor.TOOMANY': 'Sorry, you have reached the maximum number of widgets in this area'
'WidgetAreaEditor.TOOMANY': 'Sorry, you have reached the maximum number of widgets in this area',
'AssetAdmin.ConfirmDelete': 'Do you really want to delete this folder and all contained files?'
});
}