Commit cb05cfeb3bbcd3c2ac7b95e8894b3bce8f9e3c47

Authored by Julien Verneuil
1 parent a93074db

fix confirm dialog problems with content

Showing 1 changed file with 13 additions and 6 deletions   Show diff stats
web/widgets/button.anubis
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 */ 7 */
8 8
9 read calexium_lib/web/CXM_making_a_web_site.anubis 9 read calexium_lib/web/CXM_making_a_web_site.anubis
  10 +read calexium_lib/web/CXM_jquery.anubis
  11 +read calexium_lib/web/js_tools.anubis
10 read tools/basis.anubis 12 read tools/basis.anubis
11 13
12 public define HTML_Partial_Content 14 public define HTML_Partial_Content
@@ -38,12 +40,17 @@ public define HTML_Partial_Content @@ -38,12 +40,17 @@ public define HTML_Partial_Content
38 String url, 40 String url,
39 List((String, String)) extra_ops 41 List((String, String)) extra_ops
40 )= 42 )=
41 - partial_content([js(js_file("js/cxm/cxm.js"))],  
42 - image(core_attrs + [style("cursor: pointer"), event(onclick, "CalexiumToolBox.make_confirm_dialog('" + dlg_title + "',  
43 - '" + dlg_text + "',  
44 - '" + dlg_ok + "',  
45 - '" + dlg_cancel + "',  
46 - '/?a=" + url + format_extra_operands(extra_ops)+"');")], img_path, "")). 43 + with uid = generate_random_string(20),
  44 +
  45 + js_confirm_dialog_data_obj = "CalexiumToolBox.data.confirm_dialog[" + to_js_string(uid) + "]",
  46 + js_data = js_confirm_dialog_data_obj + " = {
  47 + title: " + to_js_string(dlg_title) + ",
  48 + text: " + to_js_string(dlg_text) + ",
  49 + ok : " + to_js_string(dlg_ok) + ",
  50 + cancel: " + to_js_string(dlg_cancel) + "};",
  51 +
  52 + partial_content([js(js_file("js/cxm/cxm.js")), js_inline(jquery_ready(js_data))],
  53 + image(core_attrs + [id(uid), style("cursor: pointer"), event(onclick, "CalexiumToolBox.make_confirm_dialog(this, " + to_js_string("/?a=" + url + format_extra_operands(extra_ops))+");")], img_path, "")).
47 54
48 public define HTML_Partial_Content 55 public define HTML_Partial_Content
49 img_button_confirm 56 img_button_confirm