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 () {
var item = $("<li>")
.appendTo(overlays);
- var tooltip;
if (name === "notes" || name === "data") {
- item.attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"));
- tooltip = new bootstrap.Tooltip(item[0]);
- tooltip.disable();
+ item
+ .attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
+ .tooltip("disable");
}
var label = $("<label>")
.trigger("change");
}
- $(item).attr("class", disabled ? "disabled" : "");
- if (tooltip) {
- if (disabled) {
- tooltip.enable();
- } else {
- tooltip.disable();
- }
- }
+ $(item)
+ .attr("class", disabled ? "disabled" : "")
+ .tooltip(disabled ? "enable" : "disable");
});
};
assert_no_selector ".tooltip", :text => "Zoom in"
find("h1").hover # un-hover original element
- visit "/#map=10/0/0"
+ visit "#map=10/0/0"
find(selector).hover
assert_selector ".tooltip", :text => "Zoom in"
end