-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionLoader.ts
40 lines (39 loc) · 1.14 KB
/
ActionLoader.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Generated by CoffeeScript 1.9.3
(function() {
jQuery(function() {
return jQuery('form.ajax-action').each(function(i, f) {
var $form, $result, a, resultContainerSel;
$form = $(f);
a = Action.form($form, {
clear: $form.data('clear') || false,
fadeOut: $form.data('fadeout') || false,
onSuccess: function(resp) {
var cb;
cb = eval($form.data('onsuccess'));
if (cb) {
return cb.call(resp);
}
}
});
resultContainerSel = $form.data('result-container');
$result = void 0;
if (resultContainerSel) {
$result = $(resultContainerSel);
} else {
$result = $form.find(".action-result-container");
}
if (!$result.get(0)) {
$result = $form.parent().find(".action-result-container");
}
if (!$result.get(0)) {
$result = $("<div/>").addClass("action-result-container");
$form.before($result);
}
return a.plug(ActionMsgbox, {
container: $result,
scrollOffset: $form.data('scroll-offset'),
fadeOut: false
});
});
});
}).call(this);