romo 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,11 +2,12 @@
2
2
  @import 'css/romo/mixins';
3
3
 
4
4
  .romo-label {
5
- display: inline-block;
6
- font-size: $baseFontSize;
7
- line-height: $baseLineHeight;
8
- background-color: $btnAltBackgroundHighlight;
9
- color: $btnAltColor;
5
+ display: inline-block;
6
+ font-size: $baseFontSize;
7
+ line-height: $baseLineHeight;
8
+ background-color: $btnAltBgHover;
9
+ color: $btnAltColor;
10
+
10
11
  @include label-pad($baseLineHeight);
11
12
  @include rm-push;
12
13
  @include align-center;
@@ -31,11 +32,36 @@
31
32
 
32
33
  .romo-label-block { display: block; width: 100%; }
33
34
 
34
- .romo-label.romo-label-alt { background-color: $btnBackground; color: $btnColor; }
35
- .romo-label.romo-label-primary { background-color: $btnPrimaryBackgroundHighlight; color: $btnPrimaryColor; }
36
- .romo-label.romo-label-warning { background-color: $btnWarningBackgroundHighlight; color: $btnWarningColor; }
37
- .romo-label.romo-label-error,
38
- .romo-label.romo-label-danger { background-color: $btnDangerBackgroundHighlight; color: $btnDangerColor; }
39
- .romo-label.romo-label-info { background-color: $btnInfoBackgroundHighlight; color: $btnInfoColor; }
40
- .romo-label.romo-label-success { background-color: $btnSuccessBackgroundHighlight; color: $btnSuccessColor; }
41
- .romo-label.romo-label-inverse { background-color: $btnInverseBackgroundHighlight; color: $btnInverseColor; }
35
+ /* emphasis colored labels */
36
+
37
+ .romo-label.romo-label-alt { background-color: $btnBg; color: $btnColor; }
38
+ .romo-label.romo-label-inverse { background-color: $btnInverseBg; color: $btnInverseColor; }
39
+ .romo-label.romo-label-warning { background-color: $btnWarningBg; color: $btnWarningColor; }
40
+ .romo-label.romo-label-danger { background-color: $btnDangerBg; color: $btnDangerColor; }
41
+ .romo-label.romo-label-info { background-color: $btnInfoBg; color: $btnInfoColor; }
42
+ .romo-label.romo-label-success { background-color: $btnSuccessBg; color: $btnSuccessColor; }
43
+
44
+ /* explicit colored labels */
45
+
46
+ .romo-label.romo-label-dark-red { background-color: $btnDarkRedBg; color: $btnDarkRedColor; }
47
+ .romo-label.romo-label-red { background-color: $btnRedBg; color: $btnRedColor; }
48
+ .romo-label.romo-label-light-red { background-color: $btnLightRedBg; color: $btnLightRedColor; }
49
+ .romo-label.romo-label-pastel-red { background-color: $btnPastelRedBg; color: $btnPastelRedColor; }
50
+ .romo-label.romo-label-dark-orange { background-color: $btnDarkOrangeBg; color: $btnDarkOrangeColor; }
51
+ .romo-label.romo-label-orange { background-color: $btnOrangeBg; color: $btnOrangeColor; }
52
+ .romo-label.romo-label-yellow { background-color: $btnYellowBg; color: $btnYellowColor; }
53
+ .romo-label.romo-label-pastel-yellow { background-color: $btnPastelYellowBg; color: $btnPastelYellowColor; }
54
+ .romo-label.romo-label-purple { background-color: $btnPurpleBg; color: $btnPurpleColor; }
55
+ .romo-label.romo-label-light-purple { background-color: $btnLightPurpleBg; color: $btnLightPurpleColor; }
56
+ .romo-label.romo-label-dark-pink { background-color: $btnDarkPinkBg; color: $btnDarkPinkColor; }
57
+ .romo-label.romo-label-hot-pink { background-color: $btnHotPinkBg; color: $btnHotPinkColor; }
58
+ .romo-label.romo-label-pink { background-color: $btnPinkBg; color: $btnPinkColor; }
59
+ .romo-label.romo-label-dark-green { background-color: $btnDarkGreenBg; color: $btnDarkGreenColor; }
60
+ .romo-label.romo-label-green { background-color: $btnGreenBg; color: $btnGreenColor; }
61
+ .romo-label.romo-label-light-green { background-color: $btnLightGreenBg; color: $btnLightGreenColor; }
62
+ .romo-label.romo-label-pastel-green { background-color: $btnPastelGreenBg; color: $btnPastelGreenColor; }
63
+ .romo-label.romo-label-navy { background-color: $btnNavyBg; color: $btnNavyColor; }
64
+ .romo-label.romo-label-dark-blue { background-color: $btnDarkBlueBg; color: $btnDarkBlueColor; }
65
+ .romo-label.romo-label-blue { background-color: $btnBlueBg; color: $btnBlueColor; }
66
+ .romo-label.romo-label-light-blue { background-color: $btnLightBlueBg; color: $btnLightBlueColor; }
67
+ .romo-label.romo-label-pastel-blue { background-color: $btnPastelBlueBg; color: $btnPastelBlueColor; }
@@ -21,29 +21,11 @@
21
21
  .romo-table-striped.romo-table-striped-alt tbody > tr:nth-child(odd) { @include bg-base; }
22
22
  .romo-table-striped.romo-table-striped-alt { @include bg-striped; }
23
23
 
24
- .romo-table tr.romo-base { @include bg-base(!important); }
25
- .romo-table tr.romo-alt { @include bg-alt(!important); }
26
- .romo-table tr.romo-muted { @include bg-muted(!important); }
27
- .romo-table tr.romo-warning { @include bg-warning(!important); }
28
- .romo-table tr.romo-error { @include bg-error(!important); }
29
- .romo-table tr.romo-info { @include bg-info(!important); }
30
- .romo-table tr.romo-success { @include bg-success(!important); }
31
- .romo-table tr.romo-inverse { @include bg-inverse(!important); }
32
-
33
24
  .romo-table-hover tbody tr:hover,
34
25
  .romo-table-hover.romo-table-alt tbody tr:hover,
35
26
  .romo-table-hover.romo-table-striped tbody tr:hover,
36
27
  .romo-table-hover.romo-table-striped-alt tbody tr:hover { @include bg-hover; }
37
28
 
38
- .romo-table-hover tbody tr.romo-base:hover { @include bg-base-hover(!important); }
39
- .romo-table-hover tbody tr.romo-alt:hover { @include bg-alt-hover(!important); }
40
- .romo-table-hover tbody tr.romo-muted:hover { @include bg-muted-hover(!important); }
41
- .romo-table-hover tbody tr.romo-warning:hover { @include bg-warning-hover(!important); }
42
- .romo-table-hover tbody tr.romo-error:hover { @include bg-error-hover(!important); }
43
- .romo-table-hover tbody tr.romo-info:hover { @include bg-info-hover(!important); }
44
- .romo-table-hover tbody tr.romo-success:hover { @include bg-success-hover(!important); }
45
- .romo-table-hover tbody tr.romo-inverse:hover { @include bg-inverse-hover(!important); }
46
-
47
29
  .romo-table-border,
48
30
  .romo-table-border0,
49
31
  .romo-table-border1,
@@ -62,50 +44,168 @@
62
44
  .romo-table-border2 th, .romo-table-border2 td { @include border2-bottom; @include border2-right; }
63
45
  .romo-table-border-none th, .romo-table-border-none td { @include border-style(none); }
64
46
 
65
- .romo-table-border-base { @include border-base; }
66
- .romo-table-border-alt { @include border-alt; }
67
- .romo-table-border-muted { @include border-muted; }
68
- .romo-table-border-warning { @include border-warning; }
69
- .romo-table-border-error { @include border-error; }
70
- .romo-table-border-info { @include border-info; }
71
- .romo-table-border-success { @include border-success; }
72
- .romo-table-border-inverse { @include border-inverse; }
73
-
74
- .romo-table-border-base th, .romo-table-border-base td { @include border-base; }
75
- .romo-table-border-alt th, .romo-table-border-alt td { @include border-alt; }
76
- .romo-table-border-muted th, .romo-table-border-muted td { @include border-muted; }
77
- .romo-table-border-warning th, .romo-table-border-warning td { @include border-warning; }
78
- .romo-table-border-error th, .romo-table-border-error td { @include border-error; }
79
- .romo-table-border-info th, .romo-table-border-info td { @include border-info; }
80
- .romo-table-border-success th, .romo-table-border-success td { @include border-success; }
81
- .romo-table-border-inverse th, .romo-table-border-inverse td { @include border-inverse; }
82
-
83
47
  .romo-table-pad th, .romo-table-pad td,
84
- .romo-table-pad1 th, .romo-table-pad1 td { @include pad1; }
85
- .romo-table-pad0 th, .romo-table-pad0 td { @include pad0; }
86
- .romo-table-pad2 th, .romo-table-pad2 td { @include pad2; }
48
+ .romo-table-pad1 th, .romo-table-pad1 td { @include pad1; }
49
+ .romo-table-pad0 th, .romo-table-pad0 td { @include pad0; }
50
+ .romo-table-pad2 th, .romo-table-pad2 td { @include pad2; }
87
51
  .romo-table-rm-pad th, .romo-table-rm-pad td { @include rm-pad; }
88
52
 
89
53
  .romo-table-pad-top th, .romo-table-pad-top td,
90
- .romo-table-pad1-top th, .romo-table-pad1-top td { @include pad1-top; }
91
- .romo-table-pad0-top th, .romo-table-pad0-top td { @include pad0-top; }
92
- .romo-table-pad2-top th, .romo-table-pad2-top td { @include pad2-top; }
54
+ .romo-table-pad1-top th, .romo-table-pad1-top td { @include pad1-top; }
55
+ .romo-table-pad0-top th, .romo-table-pad0-top td { @include pad0-top; }
56
+ .romo-table-pad2-top th, .romo-table-pad2-top td { @include pad2-top; }
93
57
  .romo-table-rm-pad-top th, .romo-table-rm-pad-top td { @include rm-pad-top; }
94
58
 
95
59
  .romo-table-pad-right th, .romo-table-pad-right td,
96
- .romo-table-pad1-right th, .romo-table-pad1-right td { @include pad1-right; }
97
- .romo-table-pad0-right th, .romo-table-pad0-right td { @include pad0-right; }
98
- .romo-table-pad2-right th, .romo-table-pad2-right td { @include pad2-right; }
60
+ .romo-table-pad1-right th, .romo-table-pad1-right td { @include pad1-right; }
61
+ .romo-table-pad0-right th, .romo-table-pad0-right td { @include pad0-right; }
62
+ .romo-table-pad2-right th, .romo-table-pad2-right td { @include pad2-right; }
99
63
  .romo-table-rm-pad-right th, .romo-table-rm-pad-right td { @include rm-pad-right; }
100
64
 
101
65
  .romo-table-pad-bottom th, .romo-table-pad-bottom td,
102
- .romo-table-pad1-bottom th, .romo-table-pad1-bottom td { @include pad1-bottom; }
103
- .romo-table-pad0-bottom th, .romo-table-pad0-bottom td { @include pad0-bottom; }
104
- .romo-table-pad2-bottom th, .romo-table-pad2-bottom td { @include pad2-bottom; }
66
+ .romo-table-pad1-bottom th, .romo-table-pad1-bottom td { @include pad1-bottom; }
67
+ .romo-table-pad0-bottom th, .romo-table-pad0-bottom td { @include pad0-bottom; }
68
+ .romo-table-pad2-bottom th, .romo-table-pad2-bottom td { @include pad2-bottom; }
105
69
  .romo-table-rm-pad-bottom th, .romo-table-rm-pad-bottom td { @include rm-pad-bottom; }
106
70
 
107
71
  .romo-table-pad-left th, .romo-table-pad-left td,
108
- .romo-table-pad1-left th, .romo-table-pad1-left td { @include pad1-left; }
109
- .romo-table-pad0-left th, .romo-table-pad0-left td { @include pad0-left; }
110
- .romo-table-pad2-left th, .romo-table-pad2-left td { @include pad2-left; }
72
+ .romo-table-pad1-left th, .romo-table-pad1-left td { @include pad1-left; }
73
+ .romo-table-pad0-left th, .romo-table-pad0-left td { @include pad0-left; }
74
+ .romo-table-pad2-left th, .romo-table-pad2-left td { @include pad2-left; }
111
75
  .romo-table-rm-pad-left th, .romo-table-rm-pad-left td { @include rm-pad-left; }
76
+
77
+ /* emphasis colored rows */
78
+
79
+ .romo-table tr.romo-base { @include bg-base(!important); }
80
+ .romo-table tr.romo-alt { @include bg-alt(!important); }
81
+ .romo-table tr.romo-muted { @include bg-muted(!important); }
82
+ .romo-table tr.romo-warning { @include bg-warning(!important); }
83
+ .romo-table tr.romo-danger { @include bg-danger(!important); }
84
+ .romo-table tr.romo-info { @include bg-info(!important); }
85
+ .romo-table tr.romo-success { @include bg-success(!important); }
86
+ .romo-table tr.romo-inverse { @include bg-inverse(!important); }
87
+
88
+ .romo-table-hover tbody tr.romo-base:hover { @include bg-base-hover(!important); }
89
+ .romo-table-hover tbody tr.romo-alt:hover { @include bg-alt-hover(!important); }
90
+ .romo-table-hover tbody tr.romo-muted:hover { @include bg-muted-hover(!important); }
91
+ .romo-table-hover tbody tr.romo-warning:hover { @include bg-warning-hover(!important); }
92
+ .romo-table-hover tbody tr.romo-danger:hover { @include bg-danger-hover(!important); }
93
+ .romo-table-hover tbody tr.romo-info:hover { @include bg-info-hover(!important); }
94
+ .romo-table-hover tbody tr.romo-success:hover { @include bg-success-hover(!important); }
95
+ .romo-table-hover tbody tr.romo-inverse:hover { @include bg-inverse-hover(!important); }
96
+
97
+ /* explicit colored rows */
98
+
99
+ .romo-table tr.romo-dark-red { @include bg-dark-red(!important); }
100
+ .romo-table tr.romo-red { @include bg-red(!important); }
101
+ .romo-table tr.romo-light-red { @include bg-light-red(!important); }
102
+ .romo-table tr.romo-pastel-red { @include bg-pastel-red(!important); }
103
+ .romo-table tr.romo-dark-orange { @include bg-dark-orange(!important); }
104
+ .romo-table tr.romo-orange { @include bg-orange(!important); }
105
+ .romo-table tr.romo-yellow { @include bg-yellow(!important); }
106
+ .romo-table tr.romo-pastel-yellow { @include bg-pastel-yellow(!important); }
107
+ .romo-table tr.romo-purple { @include bg-purple(!important); }
108
+ .romo-table tr.romo-light-purple { @include bg-light-purple(!important); }
109
+ .romo-table tr.romo-dark-pink { @include bg-dark-pink(!important); }
110
+ .romo-table tr.romo-hot-pink { @include bg-hot-pink(!important); }
111
+ .romo-table tr.romo-pink { @include bg-pink(!important); }
112
+ .romo-table tr.romo-dark-green { @include bg-dark-green(!important); }
113
+ .romo-table tr.romo-green { @include bg-green(!important); }
114
+ .romo-table tr.romo-light-green { @include bg-light-green(!important); }
115
+ .romo-table tr.romo-pastel-green { @include bg-pastel-green(!important); }
116
+ .romo-table tr.romo-navy { @include bg-navy(!important); }
117
+ .romo-table tr.romo-dark-blue { @include bg-dark-blue(!important); }
118
+ .romo-table tr.romo-blue { @include bg-blue(!important); }
119
+ .romo-table tr.romo-light-blue { @include bg-light-blue(!important); }
120
+ .romo-table tr.romo-pastel-blue { @include bg-pastel-blue(!important); }
121
+
122
+ .romo-table-hover tbody tr.romo-dark-red:hover { @include bg-dark-red-hover(!important); }
123
+ .romo-table-hover tbody tr.romo-red:hover { @include bg-red-hover(!important); }
124
+ .romo-table-hover tbody tr.romo-light-red:hover { @include bg-light-red-hover(!important); }
125
+ .romo-table-hover tbody tr.romo-pastel-red:hover { @include bg-pastel-red-hover(!important); }
126
+ .romo-table-hover tbody tr.romo-dark-orange:hover { @include bg-dark-orange-hover(!important); }
127
+ .romo-table-hover tbody tr.romo-orange:hover { @include bg-orange-hover(!important); }
128
+ .romo-table-hover tbody tr.romo-yellow:hover { @include bg-yellow-hover(!important); }
129
+ .romo-table-hover tbody tr.romo-pastel-yellow:hover { @include bg-pastel-yellow-hover(!important); }
130
+ .romo-table-hover tbody tr.romo-purple:hover { @include bg-purple-hover(!important); }
131
+ .romo-table-hover tbody tr.romo-light-purple:hover { @include bg-light-purple-hover(!important); }
132
+ .romo-table-hover tbody tr.romo-dark-pink:hover { @include bg-dark-pink-hover(!important); }
133
+ .romo-table-hover tbody tr.romo-hot-pink:hover { @include bg-hot-pink-hover(!important); }
134
+ .romo-table-hover tbody tr.romo-pink:hover { @include bg-pink-hover(!important); }
135
+ .romo-table-hover tbody tr.romo-dark-green:hover { @include bg-dark-green-hover(!important); }
136
+ .romo-table-hover tbody tr.romo-green:hover { @include bg-green-hover(!important); }
137
+ .romo-table-hover tbody tr.romo-light-green:hover { @include bg-light-green-hover(!important); }
138
+ .romo-table-hover tbody tr.romo-pastel-green:hover { @include bg-pastel-green-hover(!important); }
139
+ .romo-table-hover tbody tr.romo-navy:hover { @include bg-navy-hover(!important); }
140
+ .romo-table-hover tbody tr.romo-dark-blue:hover { @include bg-dark-blue-hover(!important); }
141
+ .romo-table-hover tbody tr.romo-blue:hover { @include bg-blue-hover(!important); }
142
+ .romo-table-hover tbody tr.romo-light-blue:hover { @include bg-light-blue-hover(!important); }
143
+ .romo-table-hover tbody tr.romo-pastel-blue:hover { @include bg-pastel-blue-hover(!important); }
144
+
145
+ /* emphasis colored borders */
146
+
147
+ .romo-table-border-base { @include border-base; }
148
+ .romo-table-border-alt { @include border-alt; }
149
+ .romo-table-border-muted { @include border-muted; }
150
+ .romo-table-border-warning { @include border-warning; }
151
+ .romo-table-border-danger { @include border-danger; }
152
+ .romo-table-border-info { @include border-info; }
153
+ .romo-table-border-success { @include border-success; }
154
+ .romo-table-border-inverse { @include border-inverse; }
155
+
156
+ .romo-table-border-base th, .romo-table-border-base td { @include border-base; }
157
+ .romo-table-border-alt th, .romo-table-border-alt td { @include border-alt; }
158
+ .romo-table-border-muted th, .romo-table-border-muted td { @include border-muted; }
159
+ .romo-table-border-warning th, .romo-table-border-warning td { @include border-warning; }
160
+ .romo-table-border-danger th, .romo-table-border-danger td { @include border-danger; }
161
+ .romo-table-border-info th, .romo-table-border-info td { @include border-info; }
162
+ .romo-table-border-success th, .romo-table-border-success td { @include border-success; }
163
+ .romo-table-border-inverse th, .romo-table-border-inverse td { @include border-inverse; }
164
+
165
+ /* explicit colored borders */
166
+
167
+ .romo-table-border-dark-red { @include border-dark-red; }
168
+ .romo-table-border-red { @include border-red; }
169
+ .romo-table-border-light-red { @include border-light-red; }
170
+ .romo-table-border-pastel-red { @include border-pastel-red; }
171
+ .romo-table-border-dark-orange { @include border-dark-orange; }
172
+ .romo-table-border-orange { @include border-orange; }
173
+ .romo-table-border-yellow { @include border-yellow; }
174
+ .romo-table-border-pastel-yellow { @include border-pastel-yellow; }
175
+ .romo-table-border-purple { @include border-purple; }
176
+ .romo-table-border-light-purple { @include border-light-purple; }
177
+ .romo-table-border-dark-pink { @include border-dark-pink; }
178
+ .romo-table-border-hot-pink { @include border-hot-pink; }
179
+ .romo-table-border-pink { @include border-pink; }
180
+ .romo-table-border-dark-green { @include border-dark-green; }
181
+ .romo-table-border-green { @include border-green; }
182
+ .romo-table-border-light-green { @include border-light-green; }
183
+ .romo-table-border-pastel-green { @include border-pastel-green; }
184
+ .romo-table-border-navy { @include border-navy; }
185
+ .romo-table-border-dark-blue { @include border-dark-blue; }
186
+ .romo-table-border-blue { @include border-blue; }
187
+ .romo-table-border-light-blue { @include border-light-blue; }
188
+ .romo-table-border-pastel-blue { @include border-pastel-blue; }
189
+
190
+ .romo-table-border-dark-red th, .romo-table-border-dark-red td { @include border-dark-red; }
191
+ .romo-table-border-red th, .romo-table-border-red td { @include border-red; }
192
+ .romo-table-border-light-red th, .romo-table-border-light-red td { @include border-light-red; }
193
+ .romo-table-border-pastel-red th, .romo-table-border-pastel-red td { @include border-pastel-red; }
194
+ .romo-table-border-dark-orange th, .romo-table-border-dark-orange td { @include border-dark-orange; }
195
+ .romo-table-border-orange th, .romo-table-border-orange td { @include border-orange; }
196
+ .romo-table-border-yellow th, .romo-table-border-yellow td { @include border-yellow; }
197
+ .romo-table-border-pastel-yellow th, .romo-table-border-pastel-yellow td { @include border-pastel-yellow; }
198
+ .romo-table-border-purple th, .romo-table-border-purple td { @include border-purple; }
199
+ .romo-table-border-light-purple th, .romo-table-border-light-purple td { @include border-light-purple; }
200
+ .romo-table-border-dark-pink th, .romo-table-border-dark-pink td { @include border-dark-pink; }
201
+ .romo-table-border-hot-pink th, .romo-table-border-hot-pink td { @include border-hot-pink; }
202
+ .romo-table-border-pink th, .romo-table-border-pink td { @include border-pink; }
203
+ .romo-table-border-dark-green th, .romo-table-border-dark-green td { @include border-dark-green; }
204
+ .romo-table-border-green th, .romo-table-border-green td { @include border-green; }
205
+ .romo-table-border-light-green th, .romo-table-border-light-green td { @include border-light-green; }
206
+ .romo-table-border-pastel-green th, .romo-table-border-pastel-green td { @include border-pastel-green; }
207
+ .romo-table-border-navy th, .romo-table-border-navy td { @include border-navy; }
208
+ .romo-table-border-dark-blue th, .romo-table-border-dark-blue td { @include border-dark-blue; }
209
+ .romo-table-border-blue th, .romo-table-border-blue td { @include border-blue; }
210
+ .romo-table-border-light-blue th, .romo-table-border-light-blue td { @include border-light-blue; }
211
+ .romo-table-border-pastel-blue th, .romo-table-border-pastel-blue td { @include border-pastel-blue; }
@@ -0,0 +1,114 @@
1
+ $.fn.romoAjax = function() {
2
+ return $.map(this, function(element) {
3
+ return new RomoAjax(element);
4
+ });
5
+ }
6
+
7
+ var RomoAjax = function(element) {
8
+ this.elem = $(element);
9
+ this.targetElem = $(this.elem.data('romo-ajax-target'));
10
+
11
+ this.invokeOn = this.elem.data('romo-ajax-invoke-on') || 'click';
12
+ this.callMethod = this.elem.data('romo-ajax-call-method') || 'GET';
13
+ this.urlAttr = this.elem.data('romo-ajax-url-attr') || 'href';
14
+ this.callOnlyOnce = this.elem.data('romo-ajax-call-once') === true;
15
+
16
+ this.invokeQueued = false;
17
+ this.invokeRunning = false;
18
+
19
+ this.elem.unbind(this.invokeOn);
20
+
21
+ this.doInit();
22
+ this.doBindElem();
23
+ this._trigger('romoAjax:ready', [this]);
24
+ }
25
+
26
+ RomoAjax.prototype.doInit = function() {
27
+ // override as needed
28
+ }
29
+
30
+ RomoAjax.prototype.doBindElem = function() {
31
+ this.doUnbindElem();
32
+ this.elem.on(this.invokeOn, $.proxy(this.onInvoke, this));
33
+ this.elem.on('romoAjax:triggerInvoke', $.proxy(this.onInvoke, this));
34
+ }
35
+
36
+ RomoAjax.prototype.doUnbindElem = function() {
37
+ this.elem.off(this.invokeOn, $.proxy(this.onInvoke, this));
38
+ this.elem.off('romoAjax:triggerInvoke', $.proxy(this.onInvoke, this));
39
+ }
40
+
41
+ RomoAjax.prototype.onInvoke = function(e) {
42
+ if (e !== undefined) {
43
+ e.preventDefault();
44
+ }
45
+
46
+ if (this.elem.hasClass('disabled') === false) {
47
+ this.doInvoke();
48
+ }
49
+ }
50
+
51
+ RomoAjax.prototype.doInvoke = function() {
52
+ this.invokeQueued = true;
53
+ if (this.invokeRunning === false) {
54
+ this._doInvoke();
55
+ }
56
+ }
57
+
58
+ RomoAjax.prototype.doCall = function(callUrl) {
59
+ this._trigger('romoAjax:callStart', [this]);
60
+
61
+ $.ajax({
62
+ type: this.callMethod,
63
+ url: callUrl,
64
+ success: $.proxy(this.onCallSuccess, this),
65
+ error: $.proxy(this.onCallError, this)
66
+ });
67
+ }
68
+
69
+ RomoAjax.prototype.onCallSuccess = function(data, status, xhr) {
70
+ this._trigger('romoAjax:callSuccess', [data, this]);
71
+ this._doCompleteInvoke();
72
+ }
73
+
74
+ RomoAjax.prototype.onCallError = function(xhr, errorType, error) {
75
+ this._trigger('romoAjax:callError', [xhr, this]);
76
+ this._doCompleteInvoke();
77
+ }
78
+
79
+ // private
80
+
81
+ RomoAjax.prototype._doCompleteInvoke = function() {
82
+ this._trigger('romoAjax:invoke', [this]);
83
+ if (this.invokeQueued === true) {
84
+ this._doInvoke();
85
+ } else {
86
+ this.invokeRunning = false;
87
+ }
88
+ }
89
+
90
+ RomoAjax.prototype._doInvoke = function() {
91
+ this.invokeQueued = false;
92
+ this.invokeRunning = true;
93
+ var callUrl = this.elem.attr(this.urlAttr);
94
+ if (this.callOnlyOnce === true) {
95
+ this.elem.removeAttr(this.urlAttr);
96
+ }
97
+ if (callUrl !== undefined) {
98
+ this.doCall(callUrl);
99
+ } else {
100
+ this._doCompleteInvoke();
101
+ }
102
+ }
103
+
104
+ RomoAjax.prototype._trigger = function(event_name, event_data) {
105
+ if (this.targetElem[0] !== undefined) {
106
+ this.targetElem.trigger(event_name, event_data);
107
+ } else {
108
+ this.elem.trigger(event_name, event_data);
109
+ }
110
+ }
111
+
112
+ Romo.onInitUI(function(e) {
113
+ Romo.initUIElems(e, '[data-romo-ajax-auto="true"]').romoAjax();
114
+ });