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

added dialog for gatom, font

parent 606c6a3e
...@@ -60,9 +60,14 @@ function create_window(cid, type, width, height, xpos, ypos, attr_array) { ...@@ -60,9 +60,14 @@ function create_window(cid, type, width, height, xpos, ypos, attr_array) {
$("#dialog-body").prepend(dialog_div.outerHTML) $("#dialog-body").prepend(dialog_div.outerHTML)
$("#dialog-div").prepend(data) $("#dialog-div").prepend(data)
if (f === "dialog_canvas.html" || f === "dialog_iemgui.html") { var props_map = {
$("#dialog-title").text("Canvas Properties"); "dialog_canvas.html": "Canvas",
} "dialog_iemgui.html": "Iemgui",
"dialog_gatom.html": "Atom",
"dialog_font.html": "Font"
};
$("#dialog-title").text(props_map[f] + " Properties");
$("#dialog-modal").modal("show"); $("#dialog-modal").modal("show");
// initialize the dialog window // initialize the dialog window
register_dialog(cid,attr_array); register_dialog(cid,attr_array);
......
...@@ -118,7 +118,7 @@ function apply() { ...@@ -118,7 +118,7 @@ function apply() {
function cancel() { function cancel() {
//window.close(true); //window.close(true);
if(pdgui.is_webapp()){ if(pdgui.is_webapp()){
remove_dialog(pd_object_callback) $("#dialog-modal").modal("hide");
} }
pdgui.pdsend(pd_object_callback, "cancel"); pdgui.pdsend(pd_object_callback, "cancel");
...@@ -191,6 +191,12 @@ function add_events(name) { ...@@ -191,6 +191,12 @@ function add_events(name) {
}); });
} }
pdgui.dialog_bindings(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> </script>
</body> </body>
......
...@@ -259,7 +259,7 @@ function cancel(revert_changes) { ...@@ -259,7 +259,7 @@ function cancel(revert_changes) {
var dirty = false, attr; var dirty = false, attr;
//window.close(true); //window.close(true);
if(pdgui.is_webapp()){ if(pdgui.is_webapp()){
remove_dialog(pd_object_callback) $("#dialog-modal").modal("hide");
} }
if (revert_changes) { if (revert_changes) {
...@@ -394,6 +394,12 @@ function add_events(name) { ...@@ -394,6 +394,12 @@ function add_events(name) {
}); });
} }
pdgui.dialog_bindings(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> </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