]> source.dussan.org Git - sonarqube.git/commitdiff
Fix treemap on IE7
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 15:19:27 +0000 (16:19 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 16:29:02 +0000 (17:29 +0100)
sonar-server/src/main/webapp/javascripts/application.js

index 65d32fb7d034cb7c6f6d3df95d68ef2168564177..ccb3314dd39904ca5a9f3333acc5e7a82377d1a9 100644 (file)
@@ -215,31 +215,30 @@ Treemap.prototype.initNodes = function () {
     });
   });
   $j('#tm-' + this.id).find('[rid]').each(function (index) {
-        this.on("mouseup", function (event) {
-              if (event.which == 1) {
-                var source = $j(this);
-                var rid = source.attr('rid');
-                var has_leaves = !!(source.attr('l'));
-                if (!has_leaves) {
-                  var context = new TreemapContext(rid, source.text());
-                  self.breadcrumb.push(context);
-                  self.load();
-                }
-              }
-            }
-        );
-        this.on("contextmenu", function (event) {
-          event.preventDefault();
-          // right click
-          if (self.breadcrumb.length > 1) {
-            self.breadcrumb.pop();
+      this.on("contextmenu", function (event) {
+        event.preventDefault();
+        // right click
+        if (self.breadcrumb.length > 1) {
+          self.breadcrumb.pop();
+          self.load();
+        } else {
+          location.reload();
+        }
+        return false;
+      });
+      this.on("click", function (event) {
+          var source = $j(this);
+          var rid = source.attr('rid');
+          var has_leaves = !!(source.attr('l'));
+          if (!has_leaves) {
+            var context = new TreemapContext(rid, source.text());
+            self.breadcrumb.push(context);
             self.load();
-          } else {
-            location.reload();
           }
-          return false;
-        });
-      }
+        }
+      );
+
+    }
   );
 };
 
@@ -258,23 +257,23 @@ Treemap.prototype.initNodes = function () {
             $dialog.removeClass('ui-widget-overlay');
             $dialog.html(html);
             $dialog
-                .dialog({
-                  width: ($link.attr('modal-width') || 540),
-                  draggable: false,
-                  autoOpen: false,
-                  modal: true,
-                  minHeight: 50,
-                  resizable: false,
-                  close: function () {
-                    $j('#modal').remove();
-                  }
-                });
+              .dialog({
+                width: ($link.attr('modal-width') || 540),
+                draggable: false,
+                autoOpen: false,
+                modal: true,
+                minHeight: 50,
+                resizable: false,
+                close: function () {
+                  $j('#modal').remove();
+                }
+              });
             $dialog.dialog("open");
           }).error(function () {
-                alert("Server error. Please contact your administrator.");
-              }).complete(function () {
-                $dialog.removeClass('ui-widget-overlay');
-              });
+              alert("Server error. Please contact your administrator.");
+            }).complete(function () {
+              $dialog.removeClass('ui-widget-overlay');
+            });
 
           $link.click(function () {
             $dialog.dialog('open');