[extensions-web] js: Rearrange a bit of code



commit 4eb8d75193f9c5d459b458d0a83aba234768a597
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Apr 16 17:40:37 2012 -0400

    js: Rearrange a bit of code

 sweettooth/static/js/extensions.js |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 33b6997..0d0cbb9 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -108,6 +108,11 @@ function($, messages, dbusProxy, extensionUtils, templates) {
         $switch.data('elem', $elem);
         $switch.switchify();
 
+        var svm = meta.shell_version_map || $elem.data('svm');
+        var latest = extensionUtils.grabProperExtensionVersion(svm, dbusProxy.ShellVersion);
+        if (latest !== null && latest.version > meta.version)
+            $elem.addClass('upgradable');
+
         function sendPopularity(action) {
             $.ajax({ url: '/ajax/adjust-popularity/',
                      type: 'POST',
@@ -137,11 +142,6 @@ function($, messages, dbusProxy, extensionUtils, templates) {
             }
         });
 
-        var svm = meta.shell_version_map || $elem.data('svm');
-        var latest = extensionUtils.grabProperExtensionVersion(svm, dbusProxy.ShellVersion);
-        if (latest !== null && latest.version > meta.version)
-            $elem.addClass('upgradable');
-
         // When the extension changes state...
         $elem.on('state-changed', function(e, newState) {
             $elem.data('state', newState);



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