[extensions-web] js: Only toggle the correct status links when toggling statuses



commit 3ea802f6043484dde157aee2caa646a09ade5dd6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Dec 1 16:02:12 2011 -0500

    js: Only toggle the correct status links when toggling statuses

 sweettooth/static/js/main.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 9cb0c15..1a81afe 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -104,9 +104,11 @@ require(['jquery', 'messages', 'extensions',
         $('#extension_shell_versions_info').buildShellVersionsInfo();
 
         $('.extension_status_toggle a').click(function() {
-            var href = $(this).attr('href');
-            var pk = $(this).parents('tr').data('pk');
-            var $ext = $(this).parents('.extension');
+            var $link = $(this);
+            var %tr = $link.parents('tr');
+            var href = $link.attr('href');
+            var pk = $tr.data('pk');
+            var $ext = $link.parents('.extension');
 
             var req = $.ajax({
                 type: 'GET',
@@ -118,7 +120,7 @@ require(['jquery', 'messages', 'extensions',
             req.done(function(newShellVersionMap) {
                 $ext.data('svm', newShellVersionMap);
                 $('#extension_shell_versions_info').buildShellVersionsInfo();
-                $('.extension_status_toggle').toggleClass('visible');
+                $tr.find('.extension_status_toggle').toggleClass('visible');
             });
 
             return false;



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