romo 0.19.10 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/css/romo/buttons.scss +1 -0
- data/assets/css/romo/modal.scss +5 -0
- data/assets/js/romo/ajax.js +75 -89
- data/assets/js/romo/base.js +699 -274
- data/assets/js/romo/currency_text_input.js +93 -83
- data/assets/js/romo/date.js +3 -3
- data/assets/js/romo/datepicker.js +227 -234
- data/assets/js/romo/dropdown.js +235 -344
- data/assets/js/romo/dropdown_form.js +77 -76
- data/assets/js/romo/form.js +215 -159
- data/assets/js/romo/indicator_text_input.js +64 -95
- data/assets/js/romo/inline.js +66 -59
- data/assets/js/romo/inline_form.js +74 -73
- data/assets/js/romo/modal.js +218 -294
- data/assets/js/romo/modal_form.js +83 -82
- data/assets/js/romo/onkey.js +25 -22
- data/assets/js/romo/option_list_dropdown.js +318 -298
- data/assets/js/romo/picker.js +175 -181
- data/assets/js/romo/select.js +177 -165
- data/assets/js/romo/select_dropdown.js +86 -93
- data/assets/js/romo/selected_options_list.js +66 -76
- data/assets/js/romo/sortable.js +154 -120
- data/assets/js/romo/{indicator.js → spinner.js} +74 -89
- data/assets/js/romo/tooltip.js +257 -271
- data/assets/js/romo/word_boundary_filter.js +7 -10
- data/lib/romo/dassets.rb +1 -1
- data/lib/romo/version.rb +1 -1
- data/test/unit/dassets_tests.rb +1 -1
- metadata +3 -3
@@ -1,11 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
return new RomoIndicatorTextInput(element);
|
4
|
-
});
|
5
|
-
}
|
6
|
-
|
7
|
-
var RomoIndicatorTextInput = function(element) {
|
8
|
-
this.elem = $(element);
|
1
|
+
var RomoIndicatorTextInput = RomoComponent(function(elem) {
|
2
|
+
this.elem = elem;
|
9
3
|
|
10
4
|
this.defaultIndicatorClass = undefined;
|
11
5
|
this.defaultIndicatorPaddingPx = 5;
|
@@ -14,107 +8,92 @@ var RomoIndicatorTextInput = function(element) {
|
|
14
8
|
this.doInit();
|
15
9
|
this._bindElem();
|
16
10
|
|
17
|
-
this.elem
|
18
|
-
}
|
19
|
-
|
20
|
-
RomoIndicatorTextInput.prototype.doInit = function() {
|
21
|
-
// override as needed
|
22
|
-
}
|
11
|
+
Romo.trigger(this.elem, 'romoIndicatorTextInput:ready', [this]);
|
12
|
+
});
|
23
13
|
|
24
14
|
RomoIndicatorTextInput.prototype.doEnable = function() {
|
25
|
-
this.elem.
|
26
|
-
this.elem.
|
27
|
-
this.indicatorElem.removeClass('disabled');
|
15
|
+
this.elem.disabled = false;
|
16
|
+
Romo.removeClass([this.elem, this.indicatorElem], 'disabled');
|
28
17
|
}
|
29
18
|
|
30
19
|
RomoIndicatorTextInput.prototype.doDisable = function() {
|
31
|
-
this.elem.
|
32
|
-
this.elem.
|
33
|
-
this.indicatorElem.addClass('disabled');
|
20
|
+
this.elem.disabled = true;
|
21
|
+
Romo.addClass([this.elem, this.indicatorElem], 'disabled');
|
34
22
|
}
|
35
23
|
|
36
24
|
RomoIndicatorTextInput.prototype.doShow = function() {
|
37
|
-
|
38
|
-
this._show(this.indicatorElem);
|
25
|
+
Romo.show([this.elem, this.indicatorElem]);
|
39
26
|
this._placeIndicatorElem();
|
40
27
|
}
|
41
28
|
|
42
29
|
RomoIndicatorTextInput.prototype.doHide = function() {
|
43
|
-
|
44
|
-
this._hide(this.indicatorElem);
|
30
|
+
Romo.hide([this.elem, this.indicatorElem]);
|
45
31
|
}
|
46
32
|
|
47
|
-
|
33
|
+
// private
|
48
34
|
|
49
35
|
RomoIndicatorTextInput.prototype._bindElem = function() {
|
50
|
-
var elemWrapper =
|
51
|
-
|
52
|
-
if (this.elem
|
53
|
-
|
36
|
+
var elemWrapper = Romo.elems('<div class="romo-indicator-text-input-wrapper"></div>')[0];
|
37
|
+
Romo.setStyle(elemWrapper, 'display', (Romo.data(this.elem, 'romo-indicator-text-input-elem-display') || 'inline-block'));
|
38
|
+
if (Romo.data(this.elem, 'romo-indicator-text-input-btn-group') === true) {
|
39
|
+
Romo.addClass(elemWrapper, 'romo-btn-group');
|
54
40
|
}
|
55
41
|
|
56
|
-
this.elem
|
57
|
-
|
42
|
+
Romo.before(this.elem, elemWrapper);
|
43
|
+
Romo.append(elemWrapper, this.elem);
|
44
|
+
Romo.parentChildElems.add(this.elem, [elemWrapper]);
|
58
45
|
|
59
|
-
|
60
|
-
|
61
|
-
// delay adding it b/c the `append` statement above is not a "move", it is
|
62
|
-
// a "remove" and "add" so if added immediately the "remove" part will
|
63
|
-
// incorrectly remove the wrapper. Any value will do - I chose 1 arbitrarily.
|
64
|
-
setTimeout($.proxy(function() {
|
65
|
-
Romo.parentChildElems.add(this.elem, [elemWrapper]);
|
66
|
-
}, this), 1);
|
67
|
-
|
68
|
-
this.indicatorElem = $();
|
69
|
-
var indicatorClass = this.elem.data('romo-indicator-text-input-indicator') || this.defaultIndicatorClass;
|
46
|
+
this.indicatorElem = undefined;
|
47
|
+
var indicatorClass = Romo.data(this.elem, 'romo-indicator-text-input-indicator') || this.defaultIndicatorClass;
|
70
48
|
if (indicatorClass !== undefined && indicatorClass !== 'none') {
|
71
|
-
this.indicatorElem =
|
72
|
-
|
73
|
-
this.indicatorElem
|
49
|
+
this.indicatorElem = Romo.elems('<div class="romo-indicator-text-input-indicator"><div><i class="'+indicatorClass+'"></i></div></div>')[0];
|
50
|
+
Romo.after(this.elem, this.indicatorElem);
|
51
|
+
Romo.on(this.indicatorElem, 'click', Romo.proxy(this._onIndicatorClick, this));
|
74
52
|
this._placeIndicatorElem();
|
75
53
|
|
76
|
-
this.indicatorIconContainerElem = this.indicatorElem
|
77
|
-
if (this.elem
|
78
|
-
|
79
|
-
|
80
|
-
|
54
|
+
this.indicatorIconContainerElem = Romo.find(this.indicatorElem, 'div')[0];
|
55
|
+
if (Romo.data(this.elem, 'romo-indicator-text-input-spinner-basis-size') !== undefined) {
|
56
|
+
Romo.setData(
|
57
|
+
this.indicatorIconContainerElem,
|
58
|
+
'romo-spinner-basis-size',
|
59
|
+
Romo.data(this.elem, 'romo-indicator-text-input-spinner-basis-size')
|
81
60
|
)
|
82
61
|
}
|
83
|
-
this.indicatorIconContainerElem
|
62
|
+
new RomoSpinner(this.indicatorIconContainerElem);
|
84
63
|
|
85
|
-
this.elem
|
64
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerPlaceIndicator', Romo.proxy(function(e) {
|
86
65
|
this._placeIndicatorElem();
|
87
66
|
}, this));
|
88
|
-
this.elem
|
89
|
-
this.indicatorIconContainerElem
|
67
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerSpinnerStart', Romo.proxy(function(e, basisSize) {
|
68
|
+
Romo.trigger(this.indicatorIconContainerElem, 'romoSpinner:triggerStart', [basisSize]);
|
90
69
|
}, this));
|
91
|
-
this.elem
|
92
|
-
this.indicatorIconContainerElem
|
70
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerSpinnerStop', Romo.proxy(function(e) {
|
71
|
+
Romo.trigger(this.indicatorIconContainerElem, 'romoSpinner:triggerStop');
|
93
72
|
}, this));
|
94
73
|
}
|
95
74
|
|
96
|
-
this.elem
|
75
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerEnable', Romo.proxy(function(e) {
|
97
76
|
this.doEnable();
|
98
77
|
}, this));
|
99
|
-
this.elem
|
78
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerDisable', Romo.proxy(function(e) {
|
100
79
|
this.doDisable();
|
101
80
|
}, this));
|
102
|
-
this.elem
|
81
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerShow', Romo.proxy(function(e) {
|
103
82
|
this.doShow();
|
104
83
|
}, this));
|
105
|
-
this.elem
|
84
|
+
Romo.on(this.elem, 'romoIndicatorTextInput:triggerHide', Romo.proxy(function(e) {
|
106
85
|
this.doHide();
|
107
86
|
}, this));
|
108
87
|
}
|
109
88
|
|
110
89
|
RomoIndicatorTextInput.prototype._placeIndicatorElem = function() {
|
111
90
|
if (this.indicatorElem !== undefined) {
|
112
|
-
this.indicatorElem
|
113
|
-
if (this.elem.
|
114
|
-
this.indicatorElem
|
91
|
+
Romo.setStyle(this.indicatorElem, 'line-height', Romo.css(this.elem, 'height'));
|
92
|
+
if (this.elem.disabled === true) {
|
93
|
+
Romo.addClass(this.indicatorElem, 'disabled');
|
115
94
|
}
|
116
|
-
if (this.elem
|
117
|
-
|
95
|
+
if (Romo.css(this.elem, 'display') === 'none') {
|
96
|
+
Romo.hide(this.indicatorElem);
|
118
97
|
}
|
119
98
|
|
120
99
|
var indicatorPaddingPx = this._getIndicatorPaddingPx();
|
@@ -122,58 +101,48 @@ RomoIndicatorTextInput.prototype._placeIndicatorElem = function() {
|
|
122
101
|
var indicatorPosition = this._getIndicatorPosition();
|
123
102
|
|
124
103
|
// add a pixel to account for the default input border
|
125
|
-
this.indicatorElem
|
104
|
+
Romo.setStyle(this.indicatorElem, indicatorPosition, indicatorPaddingPx+1+'px');
|
126
105
|
|
127
106
|
// left-side padding
|
128
107
|
// + indicator width
|
129
108
|
// + right-side padding
|
130
109
|
var inputPaddingPx = indicatorPaddingPx + indicatorWidthPx + indicatorPaddingPx;
|
131
|
-
this.elem
|
110
|
+
Romo.setStyle(this.elem, 'padding-'+indicatorPosition, inputPaddingPx+'px');
|
132
111
|
}
|
133
112
|
}
|
134
113
|
|
135
|
-
RomoIndicatorTextInput.prototype._onIndicatorClick = function(e) {
|
136
|
-
if (e !== undefined) {
|
137
|
-
e.preventDefault();
|
138
|
-
e.stopPropagation();
|
139
|
-
}
|
140
|
-
if (this.elem.prop('disabled') === false) {
|
141
|
-
this.elem.focus();
|
142
|
-
this.elem.trigger('indicatorTextInput:indicatorClick');
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
// private
|
147
|
-
|
148
|
-
RomoIndicatorTextInput.prototype._show = function(elem) {
|
149
|
-
elem.css('display', '');
|
150
|
-
}
|
151
|
-
|
152
|
-
RomoIndicatorTextInput.prototype._hide = function(elem) {
|
153
|
-
elem.css('display', 'none');
|
154
|
-
}
|
155
|
-
|
156
114
|
RomoIndicatorTextInput.prototype._getIndicatorPaddingPx = function() {
|
157
115
|
return (
|
158
|
-
this.elem
|
116
|
+
Romo.data(this.elem, 'romo-indicator-text-input-indicator-padding-px') ||
|
159
117
|
this.defaultIndicatorPaddingPx
|
160
118
|
);
|
161
119
|
}
|
162
120
|
|
163
121
|
RomoIndicatorTextInput.prototype._getIndicatorWidthPx = function() {
|
164
122
|
return (
|
165
|
-
this.elem
|
166
|
-
parseInt(Romo.
|
123
|
+
Romo.data(this.elem, 'romo-indicator-text-input-indicator-width-px') ||
|
124
|
+
parseInt(Romo.css(this.indicatorElem, "width"), 10)
|
167
125
|
);
|
168
126
|
}
|
169
127
|
|
170
128
|
RomoIndicatorTextInput.prototype._getIndicatorPosition = function() {
|
171
129
|
return (
|
172
|
-
this.elem
|
130
|
+
Romo.data(this.elem, 'romo-indicator-text-input-indicator-position') ||
|
173
131
|
this.defaultIndicatorPosition
|
174
132
|
);
|
175
133
|
}
|
176
134
|
|
177
|
-
|
178
|
-
|
179
|
-
|
135
|
+
// event functions
|
136
|
+
|
137
|
+
RomoIndicatorTextInput.prototype.romoEvFn._onIndicatorClick = function(e) {
|
138
|
+
e.preventDefault();
|
139
|
+
|
140
|
+
if (this.elem.disabled === false) {
|
141
|
+
this.elem.focus();
|
142
|
+
Romo.trigger(this.elem, 'romoIndicatorTextInput:indicatorClick');
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
// init
|
147
|
+
|
148
|
+
Romo.addElemsInitSelector('[data-romo-indicator-text-input-auto="true"]', RomoIndicatorTextInput);
|
data/assets/js/romo/inline.js
CHANGED
@@ -1,89 +1,96 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
var RomoInline = RomoComponent(function(elem) {
|
2
|
+
this.elem = elem;
|
3
|
+
|
4
|
+
this.doInit();
|
5
|
+
this._bindElem();
|
6
|
+
|
7
|
+
Romo.trigger(this.elem, 'romoInline:ready', [this]);
|
8
|
+
});
|
9
|
+
|
10
|
+
RomoInline.prototype.doShow = function() {
|
11
|
+
Romo.show(this.elem);
|
12
|
+
if (this.toggleElem !== undefined) {
|
13
|
+
Romo.hide(this.toggleElem);
|
14
|
+
}
|
15
|
+
Romo.trigger(this.elem, 'romoInline:show', [this]);
|
16
|
+
}
|
17
|
+
|
18
|
+
RomoInline.prototype.doDismiss = function() {
|
19
|
+
if (this.toggleElem !== undefined) {
|
20
|
+
Romo.show(this.toggleElem);
|
21
|
+
}
|
22
|
+
Romo.hide(this.elem);
|
23
|
+
Romo.trigger(this.elem, 'romoInline:dismiss', [this]);
|
5
24
|
}
|
6
25
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
this.
|
26
|
+
// private
|
27
|
+
|
28
|
+
RomoInline.prototype._bindElem = function() {
|
29
|
+
this._bindDismiss();
|
11
30
|
|
12
|
-
this.
|
13
|
-
|
31
|
+
this.toggleElem = Romo.f(Romo.data(this.elem, 'romo-inline-toggle'))[0];
|
32
|
+
|
33
|
+
Romo.on(this.elem, 'romoInline:triggerDismiss', Romo.proxy(this._onDismissClick, this));
|
34
|
+
Romo.on(this.elem, 'romoInline:triggerShow', Romo.proxy(function(e) {
|
14
35
|
this.doShow();
|
15
36
|
}, this));
|
16
37
|
|
17
|
-
this.elem
|
18
|
-
this.
|
38
|
+
Romo.on(this.elem, 'romoAjax:callStart', Romo.proxy(function(e, romoAjax) {
|
39
|
+
this._loadStart();
|
19
40
|
return false;
|
20
41
|
}, this));
|
21
|
-
this.elem
|
22
|
-
this.
|
42
|
+
Romo.on(this.elem, 'romoAjax:callSuccess', Romo.proxy(function(e, data, romoAjax) {
|
43
|
+
this._loadSuccess(data);
|
23
44
|
return false;
|
24
45
|
}, this));
|
25
|
-
this.elem
|
26
|
-
this.
|
46
|
+
Romo.on(this.elem, 'romoAjax:callError', Romo.proxy(function(e, xhr, romoAjax) {
|
47
|
+
this._loadError(xhr);
|
27
48
|
return false;
|
28
49
|
}, this));
|
29
|
-
|
30
|
-
this.doBindDismiss();
|
31
|
-
this.doInit();
|
32
|
-
this.elem.trigger('inline:ready', [this]);
|
33
50
|
}
|
34
51
|
|
35
|
-
RomoInline.prototype.
|
36
|
-
|
52
|
+
RomoInline.prototype._bindDismiss = function() {
|
53
|
+
this.dismissElems = Romo.find(this.elem, '[data-romo-inline-dismiss]');
|
54
|
+
Romo.on(this.dismissElems, 'click', Romo.proxy(this._onDismissClick, this));
|
37
55
|
}
|
38
56
|
|
39
|
-
RomoInline.prototype.
|
40
|
-
this.elem
|
41
|
-
this.elem
|
57
|
+
RomoInline.prototype._loadStart = function() {
|
58
|
+
Romo.updateHtml(this.elem, '');
|
59
|
+
Romo.trigger(this.elem, 'romoInline:loadStart', [this]);
|
42
60
|
}
|
43
61
|
|
44
|
-
RomoInline.prototype.
|
62
|
+
RomoInline.prototype._loadSuccess = function(data) {
|
45
63
|
this.doShow();
|
46
|
-
Romo.
|
47
|
-
this.
|
48
|
-
this.elem
|
64
|
+
Romo.initUpdateHtml(this.elem, data);
|
65
|
+
this._bindDismiss();
|
66
|
+
Romo.trigger(this.elem, 'romoInline:loadSuccess', [data, this]);
|
49
67
|
}
|
50
68
|
|
51
|
-
RomoInline.prototype.
|
69
|
+
RomoInline.prototype._loadError = function(xhr) {
|
52
70
|
this.doShow();
|
53
|
-
this.elem
|
71
|
+
Romo.trigger(this.elem, 'romoInline:loadError', [xhr, this]);
|
54
72
|
}
|
55
73
|
|
56
|
-
|
57
|
-
this.dismissElem = this.elem.find('[data-romo-inline-dismiss]');
|
58
|
-
this.dismissElem.unbind('click');
|
59
|
-
this.dismissElem.on('click', $.proxy(this.onDismissClick, this));
|
60
|
-
}
|
74
|
+
// event functions
|
61
75
|
|
62
|
-
RomoInline.prototype.
|
63
|
-
|
64
|
-
e.preventDefault();
|
65
|
-
}
|
76
|
+
RomoInline.prototype.romoEvFn._onDismissClick = function(e) {
|
77
|
+
e.preventDefault();
|
66
78
|
|
67
|
-
|
68
|
-
|
69
|
-
}
|
70
|
-
|
79
|
+
var disabled = this.dismissElems.reduce(function(disabled, dismissElem) {
|
80
|
+
return disabled || Romo.hasClass(dismissElem, 'disabled');
|
81
|
+
}, false);
|
82
|
+
if (!disabled) {
|
83
|
+
var confirm = this.dismissElems.reduce(function(confirm, dismissElem) {
|
84
|
+
return confirm || Romo.data(dismissElem, 'romo-inline-dismiss') === 'confirm';
|
85
|
+
}, false);
|
86
|
+
if (confirm) {
|
87
|
+
Romo.trigger(this.elem, 'romoInline:confirmDismiss', [this]);
|
88
|
+
} else {
|
89
|
+
this.doDismiss();
|
90
|
+
}
|
71
91
|
}
|
72
92
|
}
|
73
93
|
|
74
|
-
|
75
|
-
this.toggleElem.show();
|
76
|
-
this.elem.hide();
|
77
|
-
this.elem.trigger('inline:dismiss', [this]);
|
78
|
-
}
|
79
|
-
|
80
|
-
RomoInline.prototype.doShow = function() {
|
81
|
-
this.elem.show();
|
82
|
-
this.toggleElem.hide();
|
83
|
-
this.elem.trigger('inline:show', [this]);
|
84
|
-
}
|
85
|
-
|
86
|
-
Romo.onInitUI(function(e) {
|
87
|
-
Romo.initUIElems(e, '[data-romo-inline-auto="true"]').romoInline();
|
88
|
-
});
|
94
|
+
// init
|
89
95
|
|
96
|
+
Romo.addElemsInitSelector('[data-romo-inline-auto="true"]', RomoInline);
|
@@ -1,99 +1,100 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
return new RomoInlineForm(element);
|
4
|
-
});
|
5
|
-
}
|
1
|
+
var RomoInlineForm = RomoComponent(function(elem) {
|
2
|
+
this.elem = elem;
|
6
3
|
|
7
|
-
|
8
|
-
this.
|
4
|
+
this.doInit();
|
5
|
+
this._bindElem();
|
9
6
|
|
10
|
-
this.
|
11
|
-
|
7
|
+
Romo.trigger(this.elem, 'romoInlineForm:ready', [this]);
|
8
|
+
});
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
// private
|
11
|
+
|
12
|
+
RomoInlineForm.prototype._bindElem = function() {
|
13
|
+
Romo.on(this.elem, 'romoInlineForm:romoForm:triggerSubmit', Romo.proxy(function(e) {
|
14
|
+
if (this.romoForm !== undefined) {
|
15
|
+
Romo.trigger(this.romoForm.elem, 'romoForm:triggerSubmit', []);
|
17
16
|
}
|
18
17
|
}, this));
|
19
|
-
this.elem
|
20
|
-
this.
|
18
|
+
Romo.on(this.elem, 'romoInlineForm:romoInline:triggerInvoke', Romo.proxy(function(e) {
|
19
|
+
Romo.trigger(this.romoInline.elem, 'romoInline:triggerInvoke', []);
|
21
20
|
}, this));
|
22
|
-
this.elem
|
23
|
-
this.
|
21
|
+
Romo.on(this.elem, 'romoInlineForm:romoInline:triggerDismiss', Romo.proxy(function(e) {
|
22
|
+
Romo.trigger(this.romoInline.elem, 'romoInline:triggerDismiss', []);
|
24
23
|
}, this));
|
25
|
-
this.
|
26
|
-
|
27
|
-
this.
|
28
|
-
this.elem.trigger('inlineForm:formReady', [this.form, this]);
|
24
|
+
Romo.on(this.elem, 'romoInline:loadSuccess', Romo.proxy(function(e, data, romoInline) {
|
25
|
+
this._bindForm();
|
26
|
+
Romo.trigger(this.elem, 'romoInlineForm:formReady', [this.romoForm, this]);
|
29
27
|
}, this));
|
30
28
|
|
31
|
-
this.
|
32
|
-
this.
|
29
|
+
this._bindInline();
|
30
|
+
this._bindForm();
|
33
31
|
}
|
34
32
|
|
35
|
-
RomoInlineForm.prototype.
|
36
|
-
|
37
|
-
}
|
33
|
+
RomoInlineForm.prototype._bindInline = function() {
|
34
|
+
this.romoInline = new RomoInline(this.elem);
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
this.elem.trigger('inlineForm:inline:ready', [inline, this]);
|
36
|
+
Romo.on(this.elem, 'romoInline:ready', Romo.proxy(function(e, romoInline) {
|
37
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:ready', [romoInline, this]);
|
42
38
|
}, this));
|
43
|
-
this.elem
|
44
|
-
this.elem
|
39
|
+
Romo.on(this.elem, 'romoInline:loadStart', Romo.proxy(function(e, romoInline) {
|
40
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:loadStart', [romoInline, this]);
|
45
41
|
}, this));
|
46
|
-
this.elem
|
47
|
-
this.elem
|
42
|
+
Romo.on(this.elem, 'romoInline:loadSuccess', Romo.proxy(function(e, data, romoInline) {
|
43
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:loadSuccess', [data, romoInline, this]);
|
48
44
|
}, this));
|
49
|
-
this.elem
|
50
|
-
this.elem
|
45
|
+
Romo.on(this.elem, 'romoInline:loadError', Romo.proxy(function(e, xhr, romoInline) {
|
46
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:loadError', [xhr, romoInline, this]);
|
51
47
|
}, this));
|
52
|
-
this.elem
|
53
|
-
this.elem
|
48
|
+
Romo.on(this.elem, 'romoInline:show', Romo.proxy(function(e, romoInline) {
|
49
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:show', [romoInline, this]);
|
54
50
|
}, this));
|
55
|
-
this.elem
|
56
|
-
this.elem
|
51
|
+
Romo.on(this.elem, 'romoInline:dismiss', Romo.proxy(function(e, romoInline) {
|
52
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:dismiss', [romoInline, this]);
|
57
53
|
}, this));
|
58
|
-
this.elem
|
59
|
-
this.elem
|
54
|
+
Romo.on(this.elem, 'romoInline:confirmDismiss', Romo.proxy(function(e, romoInline) {
|
55
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoInline:confirmDismiss', [romoInline, this]);
|
60
56
|
}, this));
|
61
57
|
}
|
62
58
|
|
63
|
-
RomoInlineForm.prototype.
|
64
|
-
|
59
|
+
RomoInlineForm.prototype._bindForm = function() {
|
60
|
+
this.romoForm = undefined;
|
61
|
+
var formElem = Romo.find(this.elem, '[data-romo-form-auto="inlineForm"]')[0];
|
65
62
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
63
|
+
if (formElem !== undefined) {
|
64
|
+
Romo.on(formElem, 'romoForm:clearMsgs', Romo.proxy(function(e, romoForm) {
|
65
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:clearMsgs', [romoForm, this]);
|
66
|
+
}, this));
|
67
|
+
Romo.on(formElem, 'romoForm:ready', Romo.proxy(function(e, romoForm) {
|
68
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:ready', [romoForm, this]);
|
69
|
+
}, this));
|
70
|
+
Romo.on(formElem, 'romoForm:confirmSubmit', Romo.proxy(function(e, form) {
|
71
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:confirmSubmit', [romoForm, this]);
|
72
|
+
}, this));
|
73
|
+
Romo.on(formElem, 'romoForm:beforeSubmit', Romo.proxy(function(e, romoForm) {
|
74
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:beforeSubmit', [romoForm, this]);
|
75
|
+
}, this));
|
76
|
+
Romo.on(formElem, 'romoForm:submitSuccess', Romo.proxy(function(e, data, romoForm) {
|
77
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:submitSuccess', [data, romoForm, this]);
|
78
|
+
}, this));
|
79
|
+
Romo.on(formElem, 'romoForm:submitInvalidMsgs', Romo.proxy(function(e, msgs, xhr, romoForm) {
|
80
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:submitInvalidMsgs', [msgs, xhr, romoForm, this]);
|
81
|
+
}, this));
|
82
|
+
Romo.on(formElem, 'romoForm:submitXhrError', Romo.proxy(function(e, xhr, romoForm) {
|
83
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:submitXhrError', [xhr, romoForm, this]);
|
84
|
+
}, this));
|
85
|
+
Romo.on(formElem, 'romoForm:submitError', Romo.proxy(function(e, xhr, romoForm) {
|
86
|
+
Romo.trigger(this.elem, 'romoInlineForm:romoForm:submitError', [xhr, romoForm, this]);
|
87
|
+
}, this));
|
88
|
+
|
89
|
+
var submitElems = Romo.find(this.elem, '[data-romo-form-submit]');
|
90
|
+
var spinnerElems = Romo.find(this.elem, '[data-romo-spinner-auto="true"]');
|
90
91
|
|
91
|
-
|
92
|
-
|
93
|
-
this.form = formElem.romoForm(submitElement, indicatorElements)[0];
|
92
|
+
this.romoForm = new RomoForm(formElem, submitElems, spinnerElems);
|
93
|
+
}
|
94
94
|
}
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
// event functions
|
97
|
+
|
98
|
+
// init
|
99
99
|
|
100
|
+
Romo.addElemsInitSelector('[data-romo-inlineForm-auto="true"]', RomoInlineForm);
|