/* global require */
-define(["jquery", "app/common"],
- ($, common) => {
+define(["jquery", "app/common", "bootstrap"],
+ ($, common, bootstrap) => {
"use strict";
const ui = {};
$("#modalDialog .modal-header").find("[data-fa-i2svg]").addClass(icon);
$("#modalTitle").html(item.uri);
- $("#modalDialog").modal("show");
+ bootstrap.Modal.getOrCreateInstance(document.getElementById("modalDialog")).show();
},
errorMessage: "Cannot receive maps data",
server: common.getServer()
common.query("savemap", {
success: function () {
common.alertMessage("alert-success", "Map data successfully saved");
- $("#modalDialog").modal("hide");
+ bootstrap.Modal.getOrCreateInstance(document.getElementById("modalDialog")).hide();
},
errorMessage: "Save map error",
method: "POST",
-define(["jquery", "app/common", "app/tab-utils", "tabulator"],
- ($, common, tabUtils, Tabulator) => {
+define(["jquery", "app/common", "bootstrap", "app/tab-utils", "tabulator"],
+ ($, common, bootstrap, tabUtils, Tabulator) => {
"use strict";
const ui = {};
const columnsCustom = JSON.parse(localStorage.getItem("columns")) || {};
};
ui.destroyTable = function (table) {
- $("#" + table + " .tab-columns-btn.show").trigger("click.bs.dropdown");
+ const openColumnsBtn = document.querySelector("#" + table + " .tab-columns-btn.show");
+ if (openColumnsBtn) {
+ bootstrap.Dropdown.getOrCreateInstance(openColumnsBtn).hide();
+ }
$("#" + table + " .tab-columns-btn").attr("disabled", true);
if (common.tables[table]) {
common.tables[table].destroy();
.on("shown.bs.modal", () => {
$("#connectDialog").off("shown.bs.modal");
$("#connectPassword").focus();
- })
- .modal("show");
+ });
+ bootstrap.Modal.getOrCreateInstance(document.getElementById("connectDialog")).show();
$("#connectForm").off("submit").on("submit", (e) => {
e.preventDefault();
sessionStorage.setItem("read_only", data.read_only);
saveCredentials(password);
$("#connectForm").off("submit");
- $("#connectDialog").modal("hide");
+ bootstrap.Modal.getOrCreateInstance(document.getElementById("connectDialog")).hide();
displayUI();
}
},
);
}
- $("#settings").popover({
+ bootstrap.Popover.getOrCreateInstance(document.getElementById("settings"), {
container: "body",
placement: "bottom",
html: true,
// Using .clone() has the side-effect of producing elements with duplicate id attributes.
return $("#settings-popover").clone();
}
+ });
// Restore the tooltip of the element that the popover is attached to.
- }).attr("title", function () {
+ $("#settings").attr("title", function () {
return $(this).attr("data-original-title");
});
$("#settings").on("click", (e) => {
// Button (or icon within a button) that triggers the popover.
$(e.target).closest("button").attr("aria-describedby") === this.id
) return;
- $("#settings").popover("hide");
+ bootstrap.Popover.getOrCreateInstance(document.getElementById("settings")).hide();
});
});
}());