0001-js-add-new-event-when-dialog-has-finished-loading.patch
gadjo/static/js/gadjo.js | ||
---|---|---|
13 | 13 |
* class will have its action changed to simply close the dialog, without |
14 | 14 |
* server processing. |
15 | 15 |
* |
16 |
* After loading the dialog content, a gadjo:dialog-loaded event is |
|
17 |
* triggered on the anchor with the dialog content as argument. |
|
18 |
* |
|
16 | 19 |
* Alternatively the server may notice the ajax request and answer with |
17 | 20 |
* an appropriate JSON response. In that case it should have a 'content' |
18 | 21 |
* attribute with the HTML content, or a 'location' attribute in case of |
... | ... | |
45 | 48 |
var $form = $(form); |
46 | 49 |
$form.empty().append($(data.content).find(selector).children()); |
47 | 50 |
$form.find('.buttons').hide(); |
51 |
$anchor.trigger('gadjo:dialog-loaded', $form); |
|
48 | 52 |
} |
49 | 53 |
} |
50 | 54 | |
... | ... | |
117 | 121 |
if (is_json && $.fn.ajaxForm != undefined) { |
118 | 122 |
$form.ajaxForm({success: ajaxform_submit}); |
119 | 123 |
} |
124 |
$anchor.trigger('gadjo:dialog-loaded', $form); |
|
120 | 125 |
return false; |
121 | 126 |
} |
122 | 127 |
}); |
123 |
- |