]> git.wh0rd.org Git - tt-rss.git/commitdiff
clarify reset label colors function
authorAndrew Dolgov <fox@fakecake.org>
Sun, 21 Nov 2010 10:17:26 +0000 (13:17 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Sun, 21 Nov 2010 10:17:26 +0000 (13:17 +0300)
prefs.js

index 9ce1012b7b230782bb5ce1e56ccc86e6f7c1652c..bcaa6b873a4cab01bfb738adca92e2d43d8a7383 100644 (file)
--- 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) {