romo 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/js/romo/dropdown.js +14 -3
- data/assets/js/romo/dropdown_form.js +5 -1
- data/assets/js/romo/form.js +4 -2
- data/assets/js/romo/inline.js +20 -6
- data/assets/js/romo/inline_form.js +14 -1
- data/assets/js/romo/invoke.js +37 -15
- data/assets/js/romo/modal.js +14 -3
- data/assets/js/romo/modal_form.js +5 -1
- data/assets/js/romo/tooltip.js +3 -0
- data/lib/romo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d8167ef081b58a9375eb1f6b42a000b04590e2d
|
4
|
+
data.tar.gz: f5c6c2e803b1a9ef5f1a97e4ab979f35705bc936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 005eab4ae4efc9c48eb17ca3e7c0679eddcac66a639c885267d00279279f80b417d9a021cb6ee95658dd3894bf731d1bc00a7c09f337378bd893e4e5ffba0ecb
|
7
|
+
data.tar.gz: a24be3401a228beb391a488590eda3e59e470ad3c9528ad483c5f7c832bd13af838298fb519e84aca437ae7ed079126459d6ff0f252b67f3071043d7ead334e8
|
data/assets/js/romo/dropdown.js
CHANGED
@@ -8,20 +8,26 @@ var RomoDropdown = function(element) {
|
|
8
8
|
this.elem = $(element);
|
9
9
|
this.doInitPopup();
|
10
10
|
this.romoInvoke = this.elem.romoInvoke()[0];
|
11
|
+
this.romoInvoke.doUnBindInvoke(); // disable auto invoke on click
|
11
12
|
|
12
|
-
this.elem.
|
13
|
-
|
13
|
+
if (this.elem.data('romo-dropdown-disable-click-invoke') !== true) {
|
14
|
+
this.elem.unbind('click');
|
15
|
+
this.elem.on('click', $.proxy(this.onToggleClick, this));
|
16
|
+
}
|
14
17
|
this.elem.on('dropdown:triggerToggle', $.proxy(this.onToggleClick, this));
|
15
18
|
this.elem.on('dropdown:triggerPopupOpen', $.proxy(this.onPopupOpen, this));
|
16
19
|
this.elem.on('dropdown:triggerPopupClose', $.proxy(this.onPopupClose, this));
|
17
20
|
this.elem.on('invoke:loadStart', $.proxy(function(e, invoke) {
|
18
21
|
this.doLoadBodyStart();
|
22
|
+
return false;
|
19
23
|
}, this));
|
20
24
|
this.elem.on('invoke:loadSuccess', $.proxy(function(e, data, invoke) {
|
21
25
|
this.doLoadBodySuccess(data);
|
26
|
+
return false;
|
22
27
|
}, this));
|
23
28
|
this.elem.on('invoke:loadError', $.proxy(function(e, xhr, invoke) {
|
24
29
|
this.doLoadBodyError(xhr);
|
30
|
+
return false;
|
25
31
|
}, this));
|
26
32
|
|
27
33
|
this.doBindElemKeyUp();
|
@@ -197,7 +203,12 @@ RomoDropdown.prototype.onPopupOpen = function(e) {
|
|
197
203
|
}
|
198
204
|
|
199
205
|
RomoDropdown.prototype.doPopupOpen = function() {
|
200
|
-
this.
|
206
|
+
if (this.elem.data('romo-dropdown-content-elem') !== undefined) {
|
207
|
+
this.doLoadBodySuccess($(this.elem.data('romo-dropdown-content-elem')).html())
|
208
|
+
} else {
|
209
|
+
this.romoInvoke.doInvoke();
|
210
|
+
}
|
211
|
+
|
201
212
|
this.popupElem.addClass('romo-dropdown-open');
|
202
213
|
this.doPlacePopupElem();
|
203
214
|
|
@@ -19,6 +19,7 @@ var RomoDropdownForm = function(element) {
|
|
19
19
|
this.doBindForm();
|
20
20
|
this.elem.on('dropdown:loadBodySuccess', $.proxy(function(e, data, dropdown) {
|
21
21
|
this.doBindForm();
|
22
|
+
this.elem.trigger('dropdownForm:formReady', [this.form, this]);
|
22
23
|
}, this));
|
23
24
|
|
24
25
|
this.doInit();
|
@@ -69,6 +70,9 @@ RomoDropdownForm.prototype.doBindForm = function() {
|
|
69
70
|
formElem.on('form:ready', $.proxy(function(e, form) {
|
70
71
|
this.elem.trigger('dropdownForm:form:ready', [form, this]);
|
71
72
|
}, this));
|
73
|
+
formElem.on('form:confirmSubmit', $.proxy(function(e, form) {
|
74
|
+
this.elem.trigger('dropdownForm:form:confirmSubmit', [form, this]);
|
75
|
+
}, this));
|
72
76
|
formElem.on('form:beforeSubmit', $.proxy(function(e, form) {
|
73
77
|
this.elem.trigger('dropdownForm:form:beforeSubmit', [form, this]);
|
74
78
|
}, this));
|
@@ -88,7 +92,7 @@ RomoDropdownForm.prototype.doBindForm = function() {
|
|
88
92
|
this.elem.trigger('dropdownForm:form:browserSubmit', [form, this]);
|
89
93
|
}, this));
|
90
94
|
|
91
|
-
var submitElement = this.dropdown.popupElem.find('[data-romo-form-submit
|
95
|
+
var submitElement = this.dropdown.popupElem.find('[data-romo-form-submit]')[0];
|
92
96
|
var indicatorElements = this.dropdown.popupElem.find('[data-romo-indicator-auto="true"]');
|
93
97
|
this.form = formElem.romoForm(submitElement, indicatorElements)[0];
|
94
98
|
}
|
data/assets/js/romo/form.js
CHANGED
@@ -6,7 +6,7 @@ $.fn.romoForm = function(givenSubmitElement, givenIndicatorElements) {
|
|
6
6
|
|
7
7
|
var RomoForm = function(element, givenSubmitElement, givenIndicatorElements) {
|
8
8
|
this.elem = $(element);
|
9
|
-
this.defaultSubmitElem = this.elem.find('button[type="submit"], input[type="submit"], [data-romo-form-submit
|
9
|
+
this.defaultSubmitElem = this.elem.find('button[type="submit"], input[type="submit"], [data-romo-form-submit]');
|
10
10
|
this.submitElem = $(givenSubmitElement || this.defaultSubmitElem);
|
11
11
|
this.defaultIndicatorElems = this.elem.find('[data-romo-indicator-auto="true"]');
|
12
12
|
this.indicatorElems = $(givenIndicatorElements || this.defaultIndicatorElems);
|
@@ -80,7 +80,9 @@ RomoForm.prototype.onSubmitClick = function(e) {
|
|
80
80
|
e.preventDefault();
|
81
81
|
}
|
82
82
|
|
83
|
-
if (this.submitElem.
|
83
|
+
if (this.submitElem.data('romo-form-submit') === 'confirm') {
|
84
|
+
this.elem.trigger('form:confirmSubmit', [this]);
|
85
|
+
} else if (this.submitElem.hasClass('disabled') === false) {
|
84
86
|
this.doSubmit();
|
85
87
|
}
|
86
88
|
}
|
data/assets/js/romo/inline.js
CHANGED
@@ -5,20 +5,30 @@ $.fn.romoInline = function() {
|
|
5
5
|
}
|
6
6
|
|
7
7
|
var RomoInline = function(element) {
|
8
|
-
this.elem
|
9
|
-
this.toggleElem
|
8
|
+
this.elem = $(element);
|
9
|
+
this.toggleElem = $(this.elem.data('romo-inline-toggle'));
|
10
|
+
this.dismissElem = undefined;
|
11
|
+
|
12
|
+
this.elem.on('inline:triggerDismiss', $.proxy(this.onDismissClick, this));
|
13
|
+
this.elem.on('inline:triggerInvoke', $.proxy(function(e) {
|
14
|
+
this.doInvoke();
|
15
|
+
}, this));
|
10
16
|
|
11
17
|
this.elem.on('invoke:invoke', $.proxy(function(e, invoke) {
|
12
18
|
this.doInvoke();
|
19
|
+
return false;
|
13
20
|
}, this));
|
14
21
|
this.elem.on('invoke:loadStart', $.proxy(function(e, invoke) {
|
15
22
|
this.doLoadStart();
|
23
|
+
return false;
|
16
24
|
}, this));
|
17
25
|
this.elem.on('invoke:loadSuccess', $.proxy(function(e, data, invoke) {
|
18
26
|
this.doLoadSuccess(data);
|
27
|
+
return false;
|
19
28
|
}, this));
|
20
29
|
this.elem.on('invoke:loadError', $.proxy(function(e, xhr, invoke) {
|
21
30
|
this.doLoadError(xhr);
|
31
|
+
return false;
|
22
32
|
}, this));
|
23
33
|
|
24
34
|
this.doBindDismiss();
|
@@ -52,9 +62,9 @@ RomoInline.prototype.doLoadError = function(xhr) {
|
|
52
62
|
}
|
53
63
|
|
54
64
|
RomoInline.prototype.doBindDismiss = function() {
|
55
|
-
|
56
|
-
dismissElem.unbind('click');
|
57
|
-
dismissElem.on('click', $.proxy(this.onDismissClick, this));
|
65
|
+
this.dismissElem = this.elem.find('[data-romo-inline-dismiss]');
|
66
|
+
this.dismissElem.unbind('click');
|
67
|
+
this.dismissElem.on('click', $.proxy(this.onDismissClick, this));
|
58
68
|
}
|
59
69
|
|
60
70
|
RomoInline.prototype.onDismissClick = function(e) {
|
@@ -62,7 +72,11 @@ RomoInline.prototype.onDismissClick = function(e) {
|
|
62
72
|
e.preventDefault();
|
63
73
|
}
|
64
74
|
|
65
|
-
this.
|
75
|
+
if (this.dismissElem.data('romo-inline-dismiss') === 'confirm') {
|
76
|
+
this.elem.trigger('inline:confirmDismiss', [this]);
|
77
|
+
} else if (this.dismissElem.hasClass('disabled') === false) {
|
78
|
+
this.doDismiss();
|
79
|
+
}
|
66
80
|
}
|
67
81
|
|
68
82
|
RomoInline.prototype.doDismiss = function() {
|
@@ -16,9 +16,16 @@ var RomoInlineForm = function(element) {
|
|
16
16
|
this.form.elem.trigger('form:triggerSubmit', []);
|
17
17
|
}
|
18
18
|
}, this));
|
19
|
+
this.elem.on('inlineForm:inline:triggerInvoke', $.proxy(function(e) {
|
20
|
+
this.inline.elem.trigger('inline:triggerInvoke', []);
|
21
|
+
}, this));
|
22
|
+
this.elem.on('inlineForm:inline:triggerDismiss', $.proxy(function(e) {
|
23
|
+
this.inline.elem.trigger('inline:triggerDismiss', []);
|
24
|
+
}, this));
|
19
25
|
this.doBindForm();
|
20
26
|
this.elem.on('inline:loadSuccess', $.proxy(function(e, data, inline) {
|
21
27
|
this.doBindForm();
|
28
|
+
this.elem.trigger('inlineForm:formReady', [this.form, this]);
|
22
29
|
}, this));
|
23
30
|
|
24
31
|
this.doInit();
|
@@ -48,6 +55,9 @@ RomoInlineForm.prototype.doBindInline = function() {
|
|
48
55
|
this.elem.on('inline:dismiss', $.proxy(function(e, inline) {
|
49
56
|
this.elem.trigger('inlineForm:inline:dismiss', [inline, this]);
|
50
57
|
}, this));
|
58
|
+
this.elem.on('inline:confirmDismiss', $.proxy(function(e, inline) {
|
59
|
+
this.elem.trigger('inlineForm:inline:confirmDismiss', [inline, this]);
|
60
|
+
}, this));
|
51
61
|
}
|
52
62
|
|
53
63
|
RomoInlineForm.prototype.doBindForm = function() {
|
@@ -59,6 +69,9 @@ RomoInlineForm.prototype.doBindForm = function() {
|
|
59
69
|
formElem.on('form:ready', $.proxy(function(e, form) {
|
60
70
|
this.elem.trigger('inlineForm:form:ready', [form, this]);
|
61
71
|
}, this));
|
72
|
+
formElem.on('form:confirmSubmit', $.proxy(function(e, form) {
|
73
|
+
this.elem.trigger('inlineForm:form:confirmSubmit', [form, this]);
|
74
|
+
}, this));
|
62
75
|
formElem.on('form:beforeSubmit', $.proxy(function(e, form) {
|
63
76
|
this.elem.trigger('inlineForm:form:beforeSubmit', [form, this]);
|
64
77
|
}, this));
|
@@ -75,7 +88,7 @@ RomoInlineForm.prototype.doBindForm = function() {
|
|
75
88
|
this.elem.trigger('inlineForm:form:submitError', [xhr, form, this]);
|
76
89
|
}, this));
|
77
90
|
|
78
|
-
var submitElement = this.elem.find('[data-romo-form-submit
|
91
|
+
var submitElement = this.elem.find('[data-romo-form-submit]')[0];
|
79
92
|
var indicatorElements = this.elem.find('[data-romo-indicator-auto="true"]');
|
80
93
|
this.form = formElem.romoForm(submitElement, indicatorElements)[0];
|
81
94
|
}
|
data/assets/js/romo/invoke.js
CHANGED
@@ -6,11 +6,13 @@ $.fn.romoInvoke = function() {
|
|
6
6
|
|
7
7
|
var RomoInvoke = function(element) {
|
8
8
|
this.elem = $(element);
|
9
|
-
this.targetElem
|
10
|
-
this.invokeOn
|
11
|
-
this.invokeAttr
|
12
|
-
this.invokeMethod
|
13
|
-
this.loadOnlyOnce
|
9
|
+
this.targetElem = $(this.elem.data('romo-invoke-target'));
|
10
|
+
this.invokeOn = this.elem.data('romo-invoke-on') || 'click';
|
11
|
+
this.invokeAttr = this.elem.data('romo-invoke-attr') || 'href';
|
12
|
+
this.invokeMethod = this.elem.data('romo-invoke-method') || 'GET';
|
13
|
+
this.loadOnlyOnce = this.elem.data('romo-invoke-load-once') === true;
|
14
|
+
this.invokeQueued = false;
|
15
|
+
this.invokeRunning = false;
|
14
16
|
|
15
17
|
this.elem.unbind(this.invokeOn);
|
16
18
|
|
@@ -45,14 +47,9 @@ RomoInvoke.prototype.onInvoke = function(e) {
|
|
45
47
|
}
|
46
48
|
|
47
49
|
RomoInvoke.prototype.doInvoke = function() {
|
48
|
-
|
49
|
-
if (this.
|
50
|
-
this.
|
51
|
-
}
|
52
|
-
if (loadHref !== undefined) {
|
53
|
-
this.doLoad(loadHref);
|
54
|
-
} else {
|
55
|
-
this._trigger('invoke:invoke', [this]);
|
50
|
+
this.invokeQueued = true;
|
51
|
+
if (this.invokeRunning === false) {
|
52
|
+
this._doInvoke();
|
56
53
|
}
|
57
54
|
}
|
58
55
|
|
@@ -68,13 +65,38 @@ RomoInvoke.prototype.doLoad = function(href) {
|
|
68
65
|
}
|
69
66
|
|
70
67
|
RomoInvoke.prototype.onLoadAjaxSuccess = function(data, status, xhr) {
|
71
|
-
this._trigger('invoke:invoke', [this]);
|
72
68
|
this._trigger('invoke:loadSuccess', [data, this]);
|
69
|
+
this._doCompleteInvoke();
|
73
70
|
}
|
74
71
|
|
75
72
|
RomoInvoke.prototype.onLoadAjaxError = function(xhr, errorType, error) {
|
76
|
-
this._trigger('invoke:invoke', [this]);
|
77
73
|
this._trigger('invoke:loadError', [xhr, this]);
|
74
|
+
this._doCompleteInvoke();
|
75
|
+
}
|
76
|
+
|
77
|
+
// private
|
78
|
+
|
79
|
+
RomoInvoke.prototype._doCompleteInvoke = function() {
|
80
|
+
this._trigger('invoke:invoke', [this]);
|
81
|
+
if (this.invokeQueued === true) {
|
82
|
+
this._doInvoke();
|
83
|
+
} else {
|
84
|
+
this.invokeRunning = false;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
RomoInvoke.prototype._doInvoke = function() {
|
89
|
+
this.invokeQueued = false;
|
90
|
+
this.invokeRunning = true;
|
91
|
+
var loadHref = this.elem.attr(this.invokeAttr);
|
92
|
+
if (this.loadOnlyOnce === true) {
|
93
|
+
this.elem.removeAttr(this.invokeAttr);
|
94
|
+
}
|
95
|
+
if (loadHref !== undefined) {
|
96
|
+
this.doLoad(loadHref);
|
97
|
+
} else {
|
98
|
+
this._doCompleteInvoke();
|
99
|
+
}
|
78
100
|
}
|
79
101
|
|
80
102
|
RomoInvoke.prototype._trigger = function(event_name, event_data) {
|
data/assets/js/romo/modal.js
CHANGED
@@ -8,20 +8,26 @@ var RomoModal = function(element) {
|
|
8
8
|
this.elem = $(element);
|
9
9
|
this.doInitPopup();
|
10
10
|
this.romoInvoke = this.elem.romoInvoke()[0];
|
11
|
+
this.romoInvoke.doUnBindInvoke(); // disable auto invoke on click
|
11
12
|
|
12
|
-
this.elem.
|
13
|
-
|
13
|
+
if (this.elem.data('romo-modal-disable-click-invoke') !== true) {
|
14
|
+
this.elem.unbind('click');
|
15
|
+
this.elem.on('click', $.proxy(this.onToggleClick, this));
|
16
|
+
}
|
14
17
|
this.elem.on('modal:triggerToggle', $.proxy(this.onToggleClick, this));
|
15
18
|
this.elem.on('modal:triggerPopupOpen', $.proxy(this.onPopupOpen, this));
|
16
19
|
this.elem.on('modal:triggerPopupClose', $.proxy(this.onPopupClose, this));
|
17
20
|
this.elem.on('invoke:loadStart', $.proxy(function(e, invoke) {
|
18
21
|
this.doLoadBodyStart();
|
22
|
+
return false;
|
19
23
|
}, this));
|
20
24
|
this.elem.on('invoke:loadSuccess', $.proxy(function(e, data, invoke) {
|
21
25
|
this.doLoadBodySuccess(data);
|
26
|
+
return false;
|
22
27
|
}, this));
|
23
28
|
this.elem.on('invoke:loadError', $.proxy(function(e, xhr, invoke) {
|
24
29
|
this.doLoadBodyError(xhr);
|
30
|
+
return false;
|
25
31
|
}, this));
|
26
32
|
|
27
33
|
this.doBindElemKeyUp();
|
@@ -164,7 +170,12 @@ RomoModal.prototype.onPopupOpen = function(e) {
|
|
164
170
|
}
|
165
171
|
|
166
172
|
RomoModal.prototype.doPopupOpen = function() {
|
167
|
-
this.
|
173
|
+
if (this.elem.data('romo-modal-content-elem') !== undefined) {
|
174
|
+
this.doLoadBodySuccess($(this.elem.data('romo-modal-content-elem')).html())
|
175
|
+
} else {
|
176
|
+
this.romoInvoke.doInvoke();
|
177
|
+
}
|
178
|
+
|
168
179
|
this.popupElem.addClass('romo-modal-open');
|
169
180
|
this.doPlacePopupElem();
|
170
181
|
|
@@ -19,6 +19,7 @@ var RomoModalForm = function(element) {
|
|
19
19
|
this.doBindForm();
|
20
20
|
this.elem.on('modal:loadBodySuccess', $.proxy(function(e, data, modal) {
|
21
21
|
this.doBindForm();
|
22
|
+
this.elem.trigger('modalForm:formReady', [this.form, this]);
|
22
23
|
}, this));
|
23
24
|
|
24
25
|
this.doInit();
|
@@ -78,6 +79,9 @@ RomoModalForm.prototype.doBindForm = function() {
|
|
78
79
|
formElem.on('form:ready', $.proxy(function(e, form) {
|
79
80
|
this.elem.trigger('modalForm:form:ready', [form, this]);
|
80
81
|
}, this));
|
82
|
+
formElem.on('form:confirmSubmit', $.proxy(function(e, form) {
|
83
|
+
this.elem.trigger('modalForm:form:confirmSubmit', [form, this]);
|
84
|
+
}, this));
|
81
85
|
formElem.on('form:beforeSubmit', $.proxy(function(e, form) {
|
82
86
|
this.elem.trigger('modalForm:form:beforeSubmit', [form, this]);
|
83
87
|
}, this));
|
@@ -97,7 +101,7 @@ RomoModalForm.prototype.doBindForm = function() {
|
|
97
101
|
this.elem.trigger('modalForm:form:browserSubmit', [form, this]);
|
98
102
|
}, this));
|
99
103
|
|
100
|
-
var submitElement = this.modal.popupElem.find('[data-romo-form-submit
|
104
|
+
var submitElement = this.modal.popupElem.find('[data-romo-form-submit]')[0];
|
101
105
|
var indicatorElements = this.modal.popupElem.find('[data-romo-indicator-auto="true"]');
|
102
106
|
this.form = formElem.romoForm(submitElement, indicatorElements)[0];
|
103
107
|
}
|
data/assets/js/romo/tooltip.js
CHANGED
@@ -108,12 +108,15 @@ RomoTooltip.prototype.doBindInvoke = function() {
|
|
108
108
|
|
109
109
|
this.elem.on('invoke:loadStart', $.proxy(function(e, invoke) {
|
110
110
|
this.doLoadBodyStart();
|
111
|
+
return false;
|
111
112
|
}, this));
|
112
113
|
this.elem.on('invoke:loadSuccess', $.proxy(function(e, data, invoke) {
|
113
114
|
this.doLoadBodySuccess(data);
|
115
|
+
return false;
|
114
116
|
}, this));
|
115
117
|
this.elem.on('invoke:loadError', $.proxy(function(e, xhr, invoke) {
|
116
118
|
this.doLoadBodyError(xhr);
|
119
|
+
return false;
|
117
120
|
}, this));
|
118
121
|
}
|
119
122
|
|
data/lib/romo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: romo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2016-01-
|
13
|
+
date: 2016-01-25 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|