Commit a6ee1521 authored by Prakhar Agarwal's avatar Prakhar Agarwal 🎯
Browse files

improved pref dialog

parent c8838f1f
......@@ -60,11 +60,10 @@ function create_window(cid, type, width, height, xpos, ypos, attr_array) {
$("#dialog-body").prepend(dialog_div.outerHTML)
$("#dialog-div").prepend(data)
if (f === "dialog_canvas.html") {
$("#dialog-title").text("Canvas Properties");
} else if (f === "dialog_prefs.html") {
$("#dialog-title").text("Pd-L2Ork Properties");
}
var props_map = {
"dialog_prefs.html": "Pd-L20rk"
};
$("#dialog-title").text(props_map[f] + " Properties");
$("#dialog-modal").modal("show");
// initialize the dialog window
register_dialog(cid,attr_array);
......
......@@ -773,7 +773,6 @@ function cancel() {
// if you can open the Prefs dialog after clicking "Ok".
pdgui.remove_dialogwin(pd_object_callback);
if(pdgui.is_webapp()){
remove_dialog(pd_object_callback)
$("#dialog-modal").modal("hide");
}else{
window.close(true);
......@@ -1328,6 +1327,12 @@ function add_events(name) {
});
}
pdgui.dialog_bindings(name);
if (pdgui.is_webapp) {
$("#dialog-modal").on("hidden.bs.modal", function (e) {
remove_dialog(pd_object_callback)
$("#dialog-modal").off("hidden.bs.modal")
})
}
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment