From 3d456d826e88bc7ae9b07486fe9ee9f4620a35a5 Mon Sep 17 00:00:00 2001 From: Mellisa Hankins Date: Thu, 11 Jul 2013 20:15:30 +1000 Subject: [PATCH] FIX: Added confirmation dialog --- javascript/GridFieldBulkManager.js | 5 +++++ javascript/lang/en_US.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/javascript/GridFieldBulkManager.js b/javascript/GridFieldBulkManager.js index 1aee0d9..95e9a51 100644 --- a/javascript/GridFieldBulkManager.js +++ b/javascript/GridFieldBulkManager.js @@ -126,6 +126,11 @@ }); data.records = ids; + if(!confirm(ss.i18n.sprintf(ss.i18n._t('GridFieldBulkTools.ACTION_CONFIRM', 'Are you sure you want to %s %s items?'), action, ids.length))) { + e.preventDefault(); + return false; + } + if ( url.indexOf('?') !== -1 ) cacheBuster = '&cacheBuster=' + cacheBuster; else cacheBuster = '?cacheBuster=' + cacheBuster; diff --git a/javascript/lang/en_US.js b/javascript/lang/en_US.js index 1dbb9e9..6057630 100644 --- a/javascript/lang/en_US.js +++ b/javascript/lang/en_US.js @@ -4,6 +4,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { ss.i18n.addDictionary('en_US', { 'GridFieldBulkTools.FINISH_CONFIRM': "You have unsaved changes. Continuing will loose all unsaved data.\n\nDo your really want to continue?", 'GridFieldBulkTools.EDIT_CHANGED': 'Modified', - 'GridFieldBulkTools.EDIT_UPDATED': 'Saved' + 'GridFieldBulkTools.EDIT_UPDATED': 'Saved', + 'GridFieldBulkTools.ACTION_CONFIRM': 'Are you sure you want to %s %s items?' }); }