]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Use jquery interface for enabling/disabling tooltips
[rails.git] / app / assets / javascripts / application.js
index 8b8beb5b4a5164ca10a2c26652ef5662458b0024..24d50dcce623d204dfb12569d2d3ffb4696ae9c3 100644 (file)
@@ -56,20 +56,15 @@ window.updateLinks = function (loc, zoom, layers, object) {
     link.href = href;
   });
 
+  // Disable the button group and also the buttons to avoid
+  // inconsistent behaviour when zooming
   var editDisabled = zoom < 13;
-  var editTab = $("#edit_tab");
-  editTab
-    // Disable the button group and also the buttons to avoid
-    // inconsistent behaviour when zooming
+  $("#edit_tab")
+    .tooltip({ placement: "bottom" })
+    .tooltip(editDisabled ? "enable" : "disable")
     .toggleClass("disabled", editDisabled)
     .find("a")
     .toggleClass("disabled", editDisabled);
-  var editTooltip = bootstrap.Tooltip.getOrCreateInstance(editTab[0], { placement: "bottom" });
-  if (editDisabled) {
-    editTooltip.enable();
-  } else {
-    editTooltip.disable();
-  }
 };
 
 window.maximiseMap = function () {