romo 0.19.3 → 0.19.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 453dd6a22e154e5ce1632a27f69486fd706c47db
4
- data.tar.gz: ada5144693043deaa1675bee74a8a5c81df4573b
5
2
  SHA512:
6
- metadata.gz: 51d1aff498ebbd3be8ab5ca7206cca0110ac06e94354b3f0e54dc07eab660b8001d253c3541426fd6401ce5ea6a4a8a80ef58912dad98b08a6007ddc9e465f18
7
- data.tar.gz: 80d0ed512aa24f85c7109ee9e9997c16f5270492bcbb1f74a03a5f4720fb6dc2d0a93270dbf5d2b253d0603e525449ef5a8045f495b1c9a7d7afcad25fbfab35
3
+ metadata.gz: 05431cecaec71b465c4986bf8aa7df0e2a71c88a693c4d082f8937c0e562c351371e4dd45e945881297f2316a14498194969f712ceb6465cacc2532e03f78d7b
4
+ data.tar.gz: 85887b774157ab564966b5007f4f0f04c51140af7a3be6e792d01731793801a6177ffc2c20538fea6c6f63afcbd2f263e7d1789b0addd8344471f4da6180f28c
5
+ SHA1:
6
+ metadata.gz: b24ab8cacb24c8fa5e9a7a64854ee8eb9f85a5f1
7
+ data.tar.gz: 69de9ee98dabfef298bbe7b5e9fb1bf1339e133a
@@ -360,7 +360,7 @@
360
360
  @include box-shadow((inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6)));
361
361
  }
362
362
 
363
- @mixin select-optgroup {
363
+ @mixin input-option-list-optgroup {
364
364
  font-size: $fontSize0;
365
365
  line-height: $lineHeight0;
366
366
 
@@ -368,7 +368,7 @@
368
368
  color: $inputBgColor;
369
369
  }
370
370
 
371
- @mixin select-option {
371
+ @mixin input-option-list-option {
372
372
  font-size: $baseFontSize;
373
373
  line-height: $baseLineHeight;
374
374
  padding: 0 $spacingSize0;
@@ -29,7 +29,7 @@
29
29
  .romo-form input,
30
30
  .romo-form select,
31
31
  .romo-form textarea,
32
- input.romo-select-dropdown-option-filter {
32
+ input.romo-option-list-dropdown-filter {
33
33
  font-size: 100%;
34
34
  @include rm-push;
35
35
  @include align-middle;
@@ -46,7 +46,7 @@
46
46
  }
47
47
 
48
48
  .romo-form input,
49
- input.romo-select-dropdown-option-filter {
49
+ input.romo-option-list-dropdown-filter {
50
50
  *overflow: visible;
51
51
  line-height: normal;
52
52
  }
@@ -69,16 +69,16 @@
69
69
  .romo-form input[readonly],
70
70
  .romo-form select[readonly],
71
71
  .romo-form textarea[readonly],
72
- input.romo-select-dropdown-option-filter[disabled],
73
- input.romo-select-dropdown-option-filter[readonly] { cursor: $notAllowedCursor; }
72
+ input.romo-option-list-dropdown-filter[disabled],
73
+ input.romo-option-list-dropdown-filter[readonly] { cursor: $notAllowedCursor; }
74
74
 
75
75
  .romo-form select {
76
76
  font-weight: normal;
77
77
  background-color: $inputBgColor;
78
78
  @include border1;
79
79
  }
80
- .romo-form select optgroup { @include select-optgroup; }
81
- .romo-form select option { @include select-option; }
80
+ .romo-form select optgroup { @include input-option-list-optgroup; }
81
+ .romo-form select option { @include input-option-list-option; }
82
82
 
83
83
  .romo-form textarea,
84
84
  .romo-form input[type="text"],
@@ -95,7 +95,7 @@
95
95
  .romo-form input[type="search"],
96
96
  .romo-form input[type="tel"],
97
97
  .romo-form input[type="color"],
98
- input.romo-select-dropdown-option-filter {
98
+ input.romo-option-list-dropdown-filter {
99
99
  font-weight: normal;
100
100
  background-color: $inputBgColor;
101
101
  @include border1;
@@ -119,7 +119,7 @@
119
119
  .romo-form input[type="search"]::placeholder,
120
120
  .romo-form input[type="tel"]::placeholder,
121
121
  .romo-form input[type="color"]::placeholder,
122
- input.romo-select-dropdown-option-filter::placeholder {
122
+ input.romo-option-list-dropdown-filter::placeholder {
123
123
  @include input-placeholder;
124
124
  }
125
125
  .romo-form textarea::-webkit-input-placeholder, /* Chrome/Opera/Safari */
@@ -137,7 +137,7 @@
137
137
  .romo-form input[type="search"]::-webkit-input-placeholder,
138
138
  .romo-form input[type="tel"]::-webkit-input-placeholder,
139
139
  .romo-form input[type="color"]::-webkit-input-placeholder,
140
- input.romo-select-dropdown-option-filter::-webkit-input-placeholder {
140
+ input.romo-option-list-dropdown-filter::-webkit-input-placeholder {
141
141
  @include input-placeholder;
142
142
  }
143
143
  .romo-form textarea::-moz-placeholder, /* Firefox 19+ */
@@ -155,7 +155,7 @@
155
155
  .romo-form input[type="search"]::-moz-placeholder,
156
156
  .romo-form input[type="tel"]::-moz-placeholder,
157
157
  .romo-form input[type="color"]::-moz-placeholder,
158
- input.romo-select-dropdown-option-filter::-moz-placeholder {
158
+ input.romo-option-list-dropdown-filter::-moz-placeholder {
159
159
  @include input-placeholder;
160
160
  }
161
161
  .romo-form textarea:-moz-placeholder, /* Firefox 18- */
@@ -173,7 +173,7 @@
173
173
  .romo-form input[type="search"]:-moz-placeholder,
174
174
  .romo-form input[type="tel"]:-moz-placeholder,
175
175
  .romo-form input[type="color"]:-moz-placeholder,
176
- input.romo-select-dropdown-option-filter:-moz-placeholder {
176
+ input.romo-option-list-dropdown-filter:-moz-placeholder {
177
177
  @include input-placeholder;
178
178
  }
179
179
  .romo-form textarea:-ms-input-placeholder, /* IE 10+ */
@@ -191,7 +191,7 @@
191
191
  .romo-form input[type="search"]:-ms-input-placeholder,
192
192
  .romo-form input[type="tel"]:-ms-input-placeholder,
193
193
  .romo-form input[type="color"]:-ms-input-placeholder,
194
- input.romo-select-dropdown-option-filter:-ms-input-placeholder {
194
+ input.romo-option-list-dropdown-filter:-ms-input-placeholder {
195
195
  @include input-placeholder;
196
196
  }
197
197
 
@@ -211,7 +211,7 @@
211
211
  .romo-form input[type="search"]:focus,
212
212
  .romo-form input[type="tel"]:focus,
213
213
  .romo-form input[type="color"]:focus,
214
- input.romo-select-dropdown-option-filter:focus {
214
+ input.romo-option-list-dropdown-filter:focus {
215
215
  @include input-focus;
216
216
  }
217
217
 
@@ -221,8 +221,8 @@
221
221
  .romo-form input[readonly],
222
222
  .romo-form select[readonly],
223
223
  .romo-form textarea[readonly],
224
- input.romo-select-dropdown-option-filter[disabled],
225
- input.romo-select-dropdown-option-filter[readonly] { background-color: $inputDisabledColor; }
224
+ input.romo-option-list-dropdown-filter[disabled],
225
+ input.romo-option-list-dropdown-filter[readonly] { background-color: $inputDisabledColor; }
226
226
 
227
227
  .romo-form input[type="radio"][disabled],
228
228
  .romo-form input[type="checkbox"][disabled],
@@ -244,13 +244,13 @@
244
244
  .romo-form input[type="search"],
245
245
  .romo-form input[type="tel"],
246
246
  .romo-form input[type="color"],
247
- input.romo-select-dropdown-option-filter {
247
+ input.romo-option-list-dropdown-filter {
248
248
  height: $inputHeight;
249
249
  line-height: $baseLineHeight;
250
250
  @include align-middle;
251
251
  }
252
252
 
253
- input.romo-select-dropdown-option-filter {
253
+ input.romo-option-list-dropdown-filter {
254
254
  height: $inputFilterHeight;
255
255
  }
256
256
 
@@ -269,17 +269,23 @@
269
269
  .romo-form input[type="search"],
270
270
  .romo-form input[type="tel"],
271
271
  .romo-form input[type="color"],
272
- input.romo-select-dropdown-option-filter {
272
+ input.romo-option-list-dropdown-filter {
273
273
  display: inline-block;
274
274
  padding: 4px 6px;
275
275
  color: $inputColor;
276
276
  }
277
277
 
278
- input.romo-select-dropdown-option-filter {
278
+ input.romo-option-list-dropdown-filter {
279
279
  display: block;
280
280
  width: 100%;
281
281
  }
282
282
 
283
+ .romo-option-list-dropdown-filter-wrapper {
284
+ @include border1-bottom();
285
+ padding: 4px 0;
286
+ margin: 0 4px;
287
+ }
288
+
283
289
  .romo-form textarea,
284
290
  .romo-form select[multiple],
285
291
  .romo-form select[size] { height: auto; }
@@ -312,4 +318,51 @@
312
318
  @include align-middle;
313
319
  }
314
320
 
321
+ /* input option list (used by selects vie option list dropdown) */
322
+
323
+ .romo-input-option-list {
324
+ cursor: pointer;
325
+ font-weight: normal;
326
+ padding: 4px 0;
327
+ @include user-select(none);
328
+
329
+ background-color: $inputBgColor;
330
+ color: $inputColor;
331
+ }
332
+
333
+ .romo-input-option-list UL {
334
+ list-style: none outside none;
335
+ margin: 0;
336
+ padding: 0;
337
+ white-space: nowrap;
338
+ overflow: hidden;
339
+ }
340
+
341
+ .romo-input-option-list UL.romo-option-list-optgroup LI {
342
+ padding-left: $spacingSize1;
343
+ }
344
+
345
+ .romo-input-option-list LI {
346
+ @include input-option-list-option;
347
+ }
348
+
349
+ .romo-input-option-list LI[data-romo-option-list-item="optgroup"] {
350
+ @include input-option-list-optgroup;
351
+ }
352
+
353
+ .romo-input-option-list LI.romo-option-list-dropdown-highlight {
354
+ background-color: $inputHighlightBgColor;
355
+ color: $inputBgColor;
356
+ }
357
+
358
+ .romo-input-option-list LI.disabled {
359
+ cursor: $notAllowedCursor;
360
+ }
361
+
362
+ .romo-input-option-list LI.disabled,
363
+ .romo-input-option-list LI.disabled.romo-option-list-dropdown-highlight {
364
+ background-color: $inputBgColor;
365
+ color: $disabledColor;
366
+ }
367
+
315
368
  }
@@ -0,0 +1,47 @@
1
+ @import 'css/romo/vars';
2
+ @import 'css/romo/mixins';
3
+
4
+ .romo {
5
+
6
+ .romo-picker-wrapper {
7
+ display: inline-block;
8
+ text-align: left;
9
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
10
+ cursor: pointer;
11
+ @include user-select(none);
12
+ position: relative;
13
+ }
14
+
15
+ .romo-picker {
16
+ min-width: 50px;
17
+ font-weight: normal;
18
+ text-align: left;
19
+ padding-left: 6px;
20
+ padding-right: 6px;
21
+ }
22
+
23
+ .romo-picker:focus,
24
+ .romo-picker.romo-picker-focus { @include input-focus; }
25
+
26
+ .romo-picker:active,
27
+ .romo-picker.active {
28
+ background-image: none;
29
+ outline: 0;
30
+ @include box-shadow((inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)));
31
+ }
32
+
33
+ .romo-picker-text {
34
+ white-space: nowrap;
35
+ overflow: hidden;
36
+ display: inline-block;
37
+ width: 100%;
38
+ }
39
+
40
+ .romo-picker-caret {
41
+ display: inline-block;
42
+ position: absolute;
43
+ vertical-align: middle;
44
+ cursor: pointer;
45
+ }
46
+
47
+ }
@@ -40,6 +40,7 @@
40
40
  display: inline-block;
41
41
  width: 100%;
42
42
  }
43
+
43
44
  .romo-select-caret {
44
45
  display: inline-block;
45
46
  position: absolute;
@@ -47,55 +48,4 @@
47
48
  cursor: pointer;
48
49
  }
49
50
 
50
- .romo-select-dropdown-option-filter-wrapper {
51
- @include border1-bottom();
52
- padding: 4px 0;
53
- margin: 0 4px;
54
- }
55
-
56
- .romo-select-option-list {
57
- cursor: pointer;
58
- font-weight: normal;
59
- padding: 4px 0;
60
- @include user-select(none);
61
-
62
- background-color: $inputBgColor;
63
- color: $inputColor;
64
- }
65
-
66
- .romo-select-option-list UL {
67
- list-style: none outside none;
68
- margin: 0;
69
- padding: 0;
70
- white-space: nowrap;
71
- overflow: hidden;
72
- }
73
-
74
- .romo-select-option-list UL.romo-select-optgroup LI {
75
- padding-left: $spacingSize1;
76
- }
77
-
78
- .romo-select-option-list LI {
79
- @include select-option;
80
- }
81
-
82
- .romo-select-option-list LI[data-romo-select-item="optgroup"] {
83
- @include select-optgroup;
84
- }
85
-
86
- .romo-select-option-list LI.romo-select-highlight {
87
- background-color: $inputHighlightBgColor;
88
- color: $inputBgColor;
89
- }
90
-
91
- .romo-select-option-list LI.disabled {
92
- cursor: $notAllowedCursor;
93
- }
94
-
95
- .romo-select-option-list LI.disabled,
96
- .romo-select-option-list LI.disabled.romo-select-highlight {
97
- background-color: $inputBgColor;
98
- color: $disabledColor;
99
- }
100
-
101
51
  }
@@ -8,29 +8,10 @@ $.fn.romoIndicator = function() {
8
8
  }
9
9
 
10
10
  var RomoIndicator = function(element) {
11
- this.elem = $(element);
12
- this.spinnerOpts = {
13
- lines: 11, // The number of lines to draw
14
- width: 2, // The line thickness
15
- length: parseInt(this.elem.css('font-size')) / 2, // The length of each line
16
- radius: parseInt(this.elem.css('font-size')) / 3, // The radius of the inner circle
17
- corners: 1, // Corner roundness (0..1)
18
- rotate: 0, // The rotation offset
19
- direction: 1, // 1: clockwise, -1: counterclockwise
20
- color: this.elem.css('color'), // #rgb or #rrggbb or array of colors
21
- speed: 1, // Rounds per second
22
- trail: 60, // Afterglow percentage
23
- shadow: false, // Whether to render a shadow
24
- hwaccel: false, // Whether to use hardware acceleration
25
- className: 'spinner', // The CSS class to assign to the spinner
26
- zIndex: 1000, // The z-index (defaults to 2000000000)
27
- top: '50%', // Top position relative to parent
28
- left: '50%'// Left position relative to parent
29
- };
30
-
11
+ this.elem = $(element);
31
12
  this.elemStyle = this.elem.attr('style');
13
+
32
14
  this.doInit();
33
- this.spinner = new Spinner(this.spinnerOpts);
34
15
 
35
16
  this.elem.on('indicator:triggerStart', $.proxy(this.onStart, this));
36
17
  this.elem.on('indicator:triggerStop', $.proxy(this.onStop, this));
@@ -48,12 +29,12 @@ RomoIndicator.prototype.doInit = function() {
48
29
  // override as needed
49
30
  }
50
31
 
51
- RomoIndicator.prototype.onStart = function(e) {
32
+ RomoIndicator.prototype.onStart = function(e, basisSize) {
52
33
  if (e !== undefined) {
53
34
  e.preventDefault();
54
35
  }
55
36
 
56
- this.doStart();
37
+ this.doStart(basisSize);
57
38
  }
58
39
 
59
40
  RomoIndicator.prototype.onStop = function(e) {
@@ -64,7 +45,38 @@ RomoIndicator.prototype.onStop = function(e) {
64
45
  this.doStop();
65
46
  }
66
47
 
67
- RomoIndicator.prototype.doStart = function() {
48
+ RomoIndicator.prototype.doStart = function(customBasisSize) {
49
+ var basisSize = customBasisSize;
50
+ if (basisSize === undefined) {
51
+ basisSize = this.elem.data('romo-indicator-basis-size');
52
+ }
53
+ if (basisSize === undefined) {
54
+ basisSize = Math.min(
55
+ parseInt(Romo.getComputedStyle(this.elem[0], "width")),
56
+ parseInt(Romo.getComputedStyle(this.elem[0], "height"))
57
+ )
58
+ }
59
+
60
+ var spinnerOpts = {
61
+ lines: 11, // The number of lines to draw
62
+ width: 2, // The line thickness
63
+ length: parseInt(basisSize) / 4.5, // The length of each line
64
+ radius: parseInt(basisSize) / 5.5, // The radius of the inner circle
65
+ corners: 1, // Corner roundness (0..1)
66
+ rotate: 0, // The rotation offset
67
+ direction: 1, // 1: clockwise, -1: counterclockwise
68
+ color: this.elem.css('color'), // #rgb or #rrggbb or array of colors
69
+ speed: 1, // Rounds per second
70
+ trail: 60, // Afterglow percentage
71
+ shadow: false, // Whether to render a shadow
72
+ hwaccel: false, // Whether to use hardware acceleration
73
+ className: 'spinner', // The CSS class to assign to the spinner
74
+ zIndex: 1000, // The z-index (defaults to 2000000000)
75
+ top: '50%', // Top position relative to parent
76
+ left: '50%'// Left position relative to parent
77
+ };
78
+ this.spinner = new Spinner(spinnerOpts);
79
+
68
80
  this.elemHtml = this.elem.html();
69
81
  this.elemStyle = this.elem.attr('style');
70
82
  this.elem.css({
@@ -78,7 +90,10 @@ RomoIndicator.prototype.doStart = function() {
78
90
  }
79
91
 
80
92
  RomoIndicator.prototype.doStop = function() {
81
- this.spinner.stop();
93
+ if (this.spinner !== undefined) {
94
+ this.spinner.stop();
95
+ this.spinner = undefined;
96
+ }
82
97
  if (this.elemHtml !== undefined) {
83
98
  this.elem.html(this.elemHtml);
84
99
  }
@@ -12,7 +12,7 @@ var RomoIndicatorTextInput = function(element) {
12
12
  this.defaultIndicatorPosition = 'right';
13
13
 
14
14
  this.doInit();
15
- this.doBindElem();
15
+ this._bindElem();
16
16
 
17
17
  this.elem.trigger('indicatorTextInput:ready', [this]);
18
18
  }
@@ -21,7 +21,32 @@ RomoIndicatorTextInput.prototype.doInit = function() {
21
21
  // override as needed
22
22
  }
23
23
 
24
- RomoIndicatorTextInput.prototype.doBindElem = function() {
24
+ RomoIndicatorTextInput.prototype.doEnable = function() {
25
+ this.elem.prop('disabled', false);
26
+ this.elem.removeClass('disabled');
27
+ this.indicatorElem.removeClass('disabled');
28
+ }
29
+
30
+ RomoIndicatorTextInput.prototype.doDisable = function() {
31
+ this.elem.prop('disabled', true);
32
+ this.elem.addClass('disabled');
33
+ this.indicatorElem.addClass('disabled');
34
+ }
35
+
36
+ RomoIndicatorTextInput.prototype.doShow = function() {
37
+ this._show(this.elem);
38
+ this._show(this.indicatorElem);
39
+ this._placeIndicatorElem();
40
+ }
41
+
42
+ RomoIndicatorTextInput.prototype.doHide = function() {
43
+ this._hide(this.elem);
44
+ this._hide(this.indicatorElem);
45
+ }
46
+
47
+ /* private */
48
+
49
+ RomoIndicatorTextInput.prototype._bindElem = function() {
25
50
  var elemWrapper = $('<div class="romo-indicator-text-input-wrapper"></div>');
26
51
  elemWrapper.css({'display': (this.elem.data('romo-indicator-text-input-elem-display') || 'inline-block')});
27
52
  if (this.elem.data('romo-indicator-text-input-btn-group') === true) {
@@ -43,13 +68,28 @@ RomoIndicatorTextInput.prototype.doBindElem = function() {
43
68
  this.indicatorElem = $();
44
69
  var indicatorClass = this.elem.data('romo-indicator-text-input-indicator') || this.defaultIndicatorClass;
45
70
  if (indicatorClass !== undefined && indicatorClass !== 'none') {
46
- this.indicatorElem = $('<i class="romo-indicator-text-input-indicator '+indicatorClass+'"></i>');
71
+ this.indicatorElem = $('<div class="romo-indicator-text-input-indicator"><div><i class="'+indicatorClass+'"></i></div></div>');
47
72
  this.elem.after(this.indicatorElem);
48
- this.indicatorElem.on('click', $.proxy(this.onIndicatorClick, this));
49
- this.doPlaceIndicatorElem();
73
+ this.indicatorElem.on('click', $.proxy(this._onIndicatorClick, this));
74
+ this._placeIndicatorElem();
75
+
76
+ this.indicatorIconContainerElem = this.indicatorElem.find('div');
77
+ if (this.elem.data('romo-indicator-text-input-indicator-basis-size') !== undefined) {
78
+ this.indicatorIconContainerElem.attr(
79
+ 'data-romo-indicator-basis-size',
80
+ this.elem.data('romo-indicator-text-input-indicator-basis-size')
81
+ )
82
+ }
83
+ this.indicatorIconContainerElem.romoIndicator();
50
84
 
51
85
  this.elem.on('indicatorTextInput:triggerPlaceIndicator', $.proxy(function(e) {
52
- this.doPlaceIndicatorElem();
86
+ this._placeIndicatorElem();
87
+ }, this));
88
+ this.elem.on('indicatorTextInput:triggerIndicatorStart', $.proxy(function(e, basisSize) {
89
+ this.indicatorIconContainerElem.trigger('indicator:triggerStart', [basisSize]);
90
+ }, this));
91
+ this.elem.on('indicatorTextInput:triggerIndicatorStop', $.proxy(function(e) {
92
+ this.indicatorIconContainerElem.trigger('indicator:triggerStop');
53
93
  }, this));
54
94
  }
55
95
 
@@ -67,7 +107,7 @@ RomoIndicatorTextInput.prototype.doBindElem = function() {
67
107
  }, this));
68
108
  }
69
109
 
70
- RomoIndicatorTextInput.prototype.doPlaceIndicatorElem = function() {
110
+ RomoIndicatorTextInput.prototype._placeIndicatorElem = function() {
71
111
  if (this.indicatorElem !== undefined) {
72
112
  this.indicatorElem.css({'line-height': this.elem.css('height')});
73
113
  if (this.elem.prop('disabled') === true) {
@@ -92,30 +132,7 @@ RomoIndicatorTextInput.prototype.doPlaceIndicatorElem = function() {
92
132
  }
93
133
  }
94
134
 
95
- RomoIndicatorTextInput.prototype.doEnable = function() {
96
- this.elem.prop('disabled', false);
97
- this.elem.removeClass('disabled');
98
- this.indicatorElem.removeClass('disabled');
99
- }
100
-
101
- RomoIndicatorTextInput.prototype.doDisable = function() {
102
- this.elem.prop('disabled', true);
103
- this.elem.addClass('disabled');
104
- this.indicatorElem.addClass('disabled');
105
- }
106
-
107
- RomoIndicatorTextInput.prototype.doShow = function() {
108
- this._show(this.elem);
109
- this._show(this.indicatorElem);
110
- this.doPlaceIndicatorElem();
111
- }
112
-
113
- RomoIndicatorTextInput.prototype.doHide = function() {
114
- this._hide(this.elem);
115
- this._hide(this.indicatorElem);
116
- }
117
-
118
- RomoIndicatorTextInput.prototype.onIndicatorClick = function(e) {
135
+ RomoIndicatorTextInput.prototype._onIndicatorClick = function(e) {
119
136
  if (e !== undefined) {
120
137
  e.preventDefault();
121
138
  e.stopPropagation();