Commit 0eadd7a3f4cb51f19b207db9ea292dc041767291
1 parent
6f6feb06
add img_button_load_dialog and jq_dialog_load. This allows to open jquery dialog…
… by loading the HTML content with an ajax call
Showing
2 changed files
with
33 additions
and
1 deletions
Show diff stats
web/jQuery/CXM_jquery_dialog.anubis
| ... | ... | @@ -14,6 +14,7 @@ public type JQuery_dialog_id: |
| 14 | 14 | dialog_id(String id). |
| 15 | 15 | |
| 16 | 16 | public type JQuery_dialog: |
| 17 | + empty, | |
| 17 | 18 | p_content(HTML_Partial_Content content), |
| 18 | 19 | off_form(HTML_Off_Form o_form), |
| 19 | 20 | ajax(WEB_Action_Name url). |
| ... | ... | @@ -64,6 +65,8 @@ $( \"#"+dlg_id+"\" ).dialog({ |
| 64 | 65 | |
| 65 | 66 | if content is |
| 66 | 67 | { |
| 68 | + empty then | |
| 69 | + partial_content([js], div([id(dlg_id)], empty)), | |
| 67 | 70 | p_content(pc) then |
| 68 | 71 | if pc is partial_content(tags, html) then |
| 69 | 72 | partial_content( [js . tags ], div([id(dlg_id)], html)), //html code of the dialog |
| ... | ... | @@ -119,7 +122,27 @@ public define HTML_Partial_Content |
| 119 | 122 | Bool autoOpen |
| 120 | 123 | )= |
| 121 | 124 | jq_dialog_create(dial_id, content, autoOpen, auto, ""). |
| 122 | - | |
| 125 | + | |
| 126 | +public define String | |
| 127 | + jq_dialog_load | |
| 128 | + ( | |
| 129 | + JQuery_dialog_id dialog_id, | |
| 130 | + WEB_Action_Name action, | |
| 131 | + List((String,String)) extra_ops | |
| 132 | + )= | |
| 133 | + "CalexiumToolBox.jq_dialog_load('"+id(dialog_id)+"',"+format_web_action_name_to_js(action, extra_ops)+");" | |
| 134 | +. | |
| 135 | + | |
| 136 | + | |
| 137 | +public define String | |
| 138 | + jq_dialog_load | |
| 139 | + ( | |
| 140 | + JQuery_dialog_id dialog_id, | |
| 141 | + WEB_Action_Name action | |
| 142 | + )= | |
| 143 | + jq_dialog_load(dialog_id, action) | |
| 144 | +. | |
| 145 | + | |
| 123 | 146 | define String |
| 124 | 147 | _jq_dialog_open |
| 125 | 148 | ( | ... | ... |
web/widgets/button.anubis
| ... | ... | @@ -161,6 +161,15 @@ public define HTML_Partial_Content |
| 161 | 161 | )= |
| 162 | 162 | img_button(img_path, core_attrs, same, url, extra_ops). |
| 163 | 163 | |
| 164 | +public define HTML_Partial_Content | |
| 165 | + img_button_load_dialog | |
| 166 | + ( | |
| 167 | + String img_path, | |
| 168 | + List(CoreAttrs) core_attrs | |
| 169 | + )= | |
| 170 | + img_button(img_path, core_attrs, same, "", []) | |
| 171 | +. | |
| 172 | + | |
| 164 | 173 | define inline String |
| 165 | 174 | img_button_confirm_js |
| 166 | 175 | ( | ... | ... |