astra_storage["/mod.js"] = astra_storage["/mod.js"] .. [[
(function() {
"use strict";
window.SubmenuModule = {
label: "Submenu Name",
order: 999,
};
SubmenuModule.click = function() {
var modal = $.modal();
modal.addClass("main-menu");
var makeItem = function(label, link) {
modal.addChild($.element("a")
.setText(label)
.addAttr("href", link || "#")
.on("click", function(event) {
modal.remove();
}));
};
makeItem("Cesbo.com", "https://cesbo.com");
makeItem("Google", "https://google.com");
modal.addChild($.element("a")
.setText("Cancel")
.addClass("text-center")
.addAttr("href", "#/")
.on("click", function(event) {
event.preventDefault();
modal.remove();
}));
};
app.modules.push(SubmenuModule);
app.menu.push(SubmenuModule);
})();
]]
Comments