Repository: couchdb-fauxton Updated Branches: refs/heads/master 7d0d2dc10 -> 5a66c7362
Delete doc msg tweaks Two small changes: - the alert message has correct English when there's a single row selected - when nothing is selected, it alerts the user to let them know they need to select one or more rows Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5a66c736 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5a66c736 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5a66c736 Branch: refs/heads/master Commit: 5a66c73626ac6bf5f83ac13a9702cd600083e918 Parents: 7d0d2dc Author: Ben Keen <[email protected]> Authored: Thu Apr 9 14:05:38 2015 -0700 Committer: Ben Keen <[email protected]> Committed: Mon Apr 13 11:50:00 2015 -0700 ---------------------------------------------------------------------- app/addons/documents/index-results/actions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a66c736/app/addons/documents/index-results/actions.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/index-results/actions.js b/app/addons/documents/index-results/actions.js index b2cb62d..c3c10d6 100644 --- a/app/addons/documents/index-results/actions.js +++ b/app/addons/documents/index-results/actions.js @@ -117,9 +117,15 @@ function (app, FauxtonAPI, ActionTypes, Stores, HeaderStores, HeaderActions, Doc deleteSelected: function () { var itemsLength = indexResultsStore.getSelectedItemsLength(); - var msg = "Are you sure you want to delete these " + itemsLength + " docs?"; + var msg = (itemsLength === 1) ? 'Are you sure you want to delete this doc?' : + 'Are you sure you want to delete these ' + itemsLength + ' docs?'; - if (itemsLength === 0 || !window.confirm(msg)) { + if (itemsLength === 0) { + window.alert('Please select the document rows you want to delete.'); + return false; + } + + if (!window.confirm(msg)) { return false; }
