mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Custom confirm message for deleting folders in AssetAdmin
This commit is contained in:
parent
c582f08ea3
commit
7574c3177d
@ -24,8 +24,15 @@
|
|||||||
|
|
||||||
$.entwine('ss', function($){
|
$.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({
|
$('#Form_EditForm_File .ss-gridfield-item').entwine({
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
|
// Let actions do their own thing
|
||||||
|
if($(e.target).is('.action')) return;
|
||||||
|
|
||||||
var grid = this.closest('.ss-gridfield');
|
var grid = this.closest('.ss-gridfield');
|
||||||
if(this.data('class') == 'Folder') {
|
if(this.data('class') == 'Folder') {
|
||||||
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
|
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
|
||||||
@ -35,6 +42,13 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.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
|
* Class: #Form_SyncForm
|
||||||
*/
|
*/
|
||||||
|
@ -34,6 +34,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
'AssetTableField.MOVING': 'Moving %s file(s)',
|
'AssetTableField.MOVING': 'Moving %s file(s)',
|
||||||
'SecurityAdmin.BATCHACTIONSDELETECONFIRM': "Do you really want to delete %s groups?",
|
'SecurityAdmin.BATCHACTIONSDELETECONFIRM': "Do you really want to delete %s groups?",
|
||||||
'CMSMAIN.AddSearchCriteria': 'Add Criteria',
|
'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?'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user