From f695cdb2208f18adac93445ae9341074aa8df75b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 21 Nov 2010 13:17:26 +0300 Subject: [PATCH] clarify reset label colors function --- prefs.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/prefs.js b/prefs.js index 9ce1012b..bcaa6b87 100644 --- a/prefs.js +++ b/prefs.js @@ -1398,18 +1398,22 @@ function labelColorReset() { try { var labels = getSelectedLabels(); - var ok = confirm(__("Reset label colors to default?")); + if (labels.length > 0) { + var ok = confirm(__("Reset selected labels to default colors?")); - if (ok) { - - var query = "?op=pref-labels&subop=color-reset&ids="+ - param_escape(labels.toString()); + if (ok) { + var query = "?op=pref-labels&subop=color-reset&ids="+ + param_escape(labels.toString()); - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { labellist_callback2(transport); } }); + } + + } else { + alert(__("No labels are selected.")); } } catch (e) { -- 2.39.5