[extensions-web] extensions: Don't show the configurable button for uninstalled extensions



commit a7255497d6a575ca56d95242c559bad053a09d50
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Apr 9 12:28:55 2012 -0300

    extensions: Don't show the configurable button for uninstalled extensions
    
    The issue with short-circuit evaluation and fancy overloading like this.

 sweettooth/static/js/extensions.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 0567a69..ec97f44 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -142,7 +142,8 @@ function($, messages, dbusProxy, extensionUtils, templates) {
         $elem.on('state-changed', function(e, newState) {
             $elem.data('state', newState);
 
-            $elem.toggleClass('configurable', meta.hasPrefs && newState !== ExtensionState.OUT_OF_DATE);
+            var hasPrefs = !!(meta.hasPrefs && newState !== ExtensionState.OUT_OF_DATE);
+            $elem.toggleClass('configurable', hasPrefs);
 
             if (newState == ExtensionState.DISABLED ||
                 newState == ExtensionState.INITIALIZED ||



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]