romo 0.20.0 → 0.20.1

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: f26940a49cc868326a0fdd6d5d995250d6a48e06
4
- data.tar.gz: 35b274e5aecc37282b95a6a400e4cac0ad1685e3
5
2
  SHA512:
6
- metadata.gz: d5409e3fca1c02e626c6415c083bc5f27e5c0579fbb07639fdd38d6c3cca7abf3127108ca60b6f6f2c55c8687015974d24f1720c0db306053e2b17c8f0890e76
7
- data.tar.gz: fcfa1a63a2148aff2d008398070318139e7ec1ffc35349e735367524ab3cd2e1311d51752f966d560012ca7f583d2a2dd3b43e464f07e0596ac4efcc924434bd
3
+ metadata.gz: a6fd9a5bcbadfca0e0ecacfcee10ccc0e2be2417ec86612a3c17b119de68819683229f6eb84fa9342eaa801c2a8e09f00f3030bb455b3f9fd0ca22651c7a4be9
4
+ data.tar.gz: 042f45707374689346fc7ef9ff25aeef724c2e5b35923942bb7da3c9215274bb8e3493d700a33ed8b2a995d8daccfee10f0664a119025e30f48204f83b0883bc
5
+ SHA1:
6
+ metadata.gz: d706f352079822fd3b5029ff291113174f13fbd3
7
+ data.tar.gz: bfb7ba99253ced27d7e8762d34e937c574f4a8cd
@@ -13,9 +13,10 @@
13
13
  .romo-text-alt-hover:hover, a.romo-text-alt:hover, a.romo-text-alt:focus { @include text-alt-hover(!important); }
14
14
  .romo-text-muted-hover:hover, a.romo-text-muted:hover, a.romo-text-muted:focus { @include text-muted-hover(!important); }
15
15
 
16
- .romo-bg-base { @include bg-base(!important); }
17
- .romo-bg-alt { @include bg-alt(!important); }
18
- .romo-bg-muted { @include bg-muted(!important); }
16
+ .romo-bg-base { @include bg-base(!important); }
17
+ .romo-bg-alt { @include bg-alt(!important); }
18
+ .romo-bg-muted { @include bg-muted(!important); }
19
+ .romo-bg-striped { @include bg-striped(!important); }
19
20
 
20
21
  .romo-bg-base-hover:hover, a.romo-bg-base:hover, a.romo-bg-base:focus { @include bg-base-hover(!important); }
21
22
  .romo-bg-alt-hover:hover, a.romo-bg-alt:hover, a.romo-bg-alt:focus { @include bg-alt-hover(!important); }
@@ -242,6 +242,14 @@ Romo.prototype.hide = function(elems) {
242
242
  });
243
243
  }
244
244
 
245
+ Romo.prototype.height = function(elem) {
246
+ return elem.getBoundingClientRect().height;
247
+ }
248
+
249
+ Romo.prototype.width = function(elem) {
250
+ return elem.getBoundingClientRect().width;
251
+ }
252
+
245
253
  Romo.prototype.offset = function(elem) {
246
254
  var elemRect = elem.getBoundingClientRect();
247
255
  var bodyRect = document.body.getBoundingClientRect();
@@ -309,7 +317,7 @@ Romo.prototype.parseElemZIndex = function(elem) {
309
317
  // elems init
310
318
 
311
319
  Romo.prototype.elems = function(htmlString) {
312
- var context = document.implementation.createHTMLDocument();
320
+ var context = document.implementation.createHTMLDocument('');
313
321
 
314
322
  // Set the base href for the created document so any parsed
315
323
  // elements with URLs are based on the document's URL
@@ -1066,7 +1074,7 @@ RomoParentChildElems.prototype.doInit = function(parentElem, childElems) {
1066
1074
  var parentRemovedObserver = new MutationObserver(Romo.proxy(function(mutationRecords) {
1067
1075
  mutationRecords.forEach(Romo.proxy(function(mutationRecord) {
1068
1076
  if (mutationRecord.type === 'childList' && mutationRecord.removedNodes.length > 0) {
1069
- mutationRecord.removedNodes.forEach(Romo.proxy(function(removedNode) {
1077
+ Romo.array(mutationRecord.removedNodes).forEach(Romo.proxy(function(removedNode) {
1070
1078
  this.remove(removedNode);
1071
1079
  }, this));
1072
1080
  }
@@ -100,7 +100,7 @@ RomoDatepicker.prototype._bindDropdown = function() {
100
100
  if (Romo.data(this.elem, 'romo-dropdown-width') === undefined) {
101
101
  Romo.setData(this.elem, 'romo-dropdown-width', 'elem');
102
102
  }
103
- if (parseInt(Romo.css(this.elem, 'width'), 10) < 175) {
103
+ if (Romo.width(this.elem) < 175) {
104
104
  Romo.setData(this.elem, 'romo-dropdown-width', '175px');
105
105
  }
106
106
  this.romoDropdown = new RomoDropdown(this.elem);
@@ -64,11 +64,10 @@ RomoDropdown.prototype.doPlacePopupElem = function() {
64
64
  Romo.setStyle(this.contentElem, 'max-height', contentMaxHeight.toString() + 'px');
65
65
  }
66
66
 
67
- var elemRect = this.elem.getBoundingClientRect();
68
67
  var elemOffset = Romo.offset(this.elem);
69
68
 
70
- var elemHeight = elemRect.height;
71
- var elemWidth = elemRect.width;
69
+ var elemHeight = Romo.height(this.elem);
70
+ var elemWidth = Romo.width(this.elem);
72
71
  var elemTop = elemOffset.top;
73
72
  var elemLeft = elemOffset.left
74
73
 
@@ -158,9 +157,7 @@ RomoDropdown.prototype._bindPopup = function() {
158
157
  );
159
158
  Romo.append(popupParentElem, this.popupElem);
160
159
 
161
- this.bodyElem = Romo.children(this.popupElem).find(Romo.proxy(function(childElem) {
162
- return Romo.is(childElem, '.romo-dropdown-body');
163
- }, this));
160
+ this.bodyElem = Romo.children(this.popupElem, '.romo-dropdown-body')[0];
164
161
  if (Romo.data(this.elem, 'romo-dropdown-style-class') !== undefined) {
165
162
  Romo.addClass(this.bodyElem, Romo.data(this.elem, 'romo-dropdown-style-class'));
166
163
  }
@@ -227,7 +224,7 @@ RomoDropdown.prototype._bindBody = function() {
227
224
  }
228
225
 
229
226
  if (Romo.data(this.elem, 'romo-dropdown-width') === 'elem') {
230
- Romo.setStyle(this.popupElem, 'width', Romo.css(this.elem, 'width'));
227
+ Romo.setStyle(this.popupElem, 'width', Romo.width(this.elem)+'px');
231
228
  } else {
232
229
  Romo.setStyle(this.contentElem, 'min-width', Romo.data(this.elem, 'romo-dropdown-min-width'));
233
230
  Romo.setStyle(this.contentElem, 'max-width', Romo.data(this.elem, 'romo-dropdown-max-width'));
@@ -88,7 +88,7 @@ RomoIndicatorTextInput.prototype._bindElem = function() {
88
88
 
89
89
  RomoIndicatorTextInput.prototype._placeIndicatorElem = function() {
90
90
  if (this.indicatorElem !== undefined) {
91
- Romo.setStyle(this.indicatorElem, 'line-height', Romo.css(this.elem, 'height'));
91
+ Romo.setStyle(this.indicatorElem, 'line-height', Romo.height(this.elem)+'px');
92
92
  if (this.elem.disabled === true) {
93
93
  Romo.addClass(this.indicatorElem, 'disabled');
94
94
  }
@@ -121,7 +121,7 @@ RomoIndicatorTextInput.prototype._getIndicatorPaddingPx = function() {
121
121
  RomoIndicatorTextInput.prototype._getIndicatorWidthPx = function() {
122
122
  return (
123
123
  Romo.data(this.elem, 'romo-indicator-text-input-indicator-width-px') ||
124
- parseInt(Romo.css(this.indicatorElem, "width"), 10)
124
+ Romo.width(this.indicatorElem)
125
125
  );
126
126
  }
127
127
 
@@ -113,9 +113,7 @@ RomoModal.prototype._bindPopup = function() {
113
113
  var popupParentElem = Romo.closest(this.elem, Romo.data(this.elem, 'romo-dropdown-append-to-closest') || 'body');
114
114
  Romo.append(popupParentElem, this.popupElem)
115
115
 
116
- this.bodyElem = Romo.children(this.popupElem).find(Romo.proxy(function(childElem){
117
- return Romo.is(childElem, '.romo-modal-body');
118
- }, this));
116
+ this.bodyElem = Romo.children(this.popupElem, '.romo-modal-body')[0];
119
117
  if (Romo.data(this.elem, 'romo-modal-style-class') !== undefined) {
120
118
  Romo.addClass(this.bodyElem, Romo.data(this.elem, 'romo-modal-style-class'));
121
119
  }
@@ -230,8 +228,8 @@ RomoModal.prototype._dragStart = function(e) {
230
228
 
231
229
  Romo.popupStack.closeTo(this.popupElem);
232
230
 
233
- Romo.setStyle(this.popupElem, 'width', Romo.css(this.popupElem, 'width'));
234
- Romo.setStyle(this.popupElem, 'height', Romo.css(this.popupElem, 'height'));
231
+ Romo.setStyle(this.popupElem, 'width', Romo.width(this.popupElem)+'px');
232
+ Romo.setStyle(this.popupElem, 'height', Romo.height(this.popupElem)+'px');
235
233
 
236
234
  this._dragDiffX = e.clientX - this.popupElem.offsetLeft;
237
235
  this._dragDiffY = e.clientY - this.popupElem.offsetTop;
@@ -164,7 +164,7 @@ RomoOptionListDropdown.prototype._bindElem = function() {
164
164
  Romo.trigger(
165
165
  this.optionFilterElem,
166
166
  'romoIndicatorTextInput:triggerSpinnerStart',
167
- [Romo.css(this.optionFilterElem, "height")]
167
+ [Romo.height(this.optionFilterElem)+'px']
168
168
  );
169
169
  }, this));
170
170
  Romo.on(this.elem, 'romoOptionListDropdown:triggerFilterSpinnerStop', Romo.proxy(function(e) {
@@ -393,7 +393,7 @@ RomoOptionListDropdown.prototype._scrollTopToItem = function(itemElem) {
393
393
 
394
394
  var scrollOffsetTop = Romo.offset(scrollElem).top;
395
395
  var selOffsetTop = Romo.offset(itemElem).top;
396
- var selOffset = parseInt(Romo.css(itemElem, 'height'), 10) / 2;
396
+ var selOffset = Romo.height(itemElem) / 2;
397
397
 
398
398
  scrollElem.scrollTop = selOffsetTop - scrollOffsetTop - selOffset;
399
399
  }
@@ -406,7 +406,7 @@ RomoOptionListDropdown.prototype._scrollBottomToItem = function(itemElem) {
406
406
 
407
407
  var scrollOffsetTop = Romo.offset(scrollElem).top;
408
408
  var selOffsetTop = Romo.offset(itemElem).top;
409
- var selOffset = scrollElem.offsetHeight - parseInt(Romo.css(itemElem, 'height'), 10);
409
+ var selOffset = scrollElem.offsetHeight - Romo.height(itemElem);
410
410
 
411
411
  scrollElem.scrollTop = selOffsetTop - scrollOffsetTop - selOffset;
412
412
  }
@@ -555,7 +555,7 @@ RomoOptionListDropdown.prototype.romoEvFn._onPopupOpenBodyKeyDown = function(e)
555
555
 
556
556
  var scrollElem = this.romoDropdown.bodyElem;
557
557
  var scrollOffset = Romo.offset(scrollElem);
558
- var scrollHeight = parseInt(Romo.css(scrollElem, 'height'), 10);
558
+ var scrollHeight = Romo.height(scrollElem);
559
559
 
560
560
  if (e.keyCode === 38 /* Up */) {
561
561
  var prevElem = this._prevListItem();
@@ -577,7 +577,7 @@ RomoOptionListDropdown.prototype.romoEvFn._onPopupOpenBodyKeyDown = function(e)
577
577
  if(nextElem === undefined){ return false; }
578
578
 
579
579
  var nextOffset = Romo.offset(nextElem);
580
- var nextHeight = parseInt(Romo.css(nextElem, 'height'), 10);
580
+ var nextHeight = Romo.height(nextElem);
581
581
 
582
582
  this._highlightItem(nextElem);
583
583
 
@@ -218,7 +218,7 @@ RomoPicker.prototype._buildOptionListDropdownElem = function() {
218
218
  if (Romo.attr(this.elem, 'style') !== undefined) {
219
219
  Romo.setAttr(romoOptionListDropdownElem, 'style', Romo.attr(this.elem, 'style'));
220
220
  }
221
- Romo.setStyle(romoOptionListDropdownElem, 'width', Romo.css(this.elem, 'width'));
221
+ Romo.setStyle(romoOptionListDropdownElem, 'width', Romo.width(this.elem)+'px');
222
222
  if (Romo.attr(this.elem, 'disabled') !== undefined) {
223
223
  Romo.setAttr(this.romoOptionListDropdown.elem, 'disabled', Romo.attr(this.elem, 'disabled'));
224
224
  }
@@ -238,7 +238,7 @@ RomoPicker.prototype._buildOptionListDropdownElem = function() {
238
238
  var caretClass = Romo.data(this.elem, 'romo-picker-caret') || this.defaultCaretClass;
239
239
  if (caretClass !== undefined && caretClass !== 'none') {
240
240
  this.caretElem = Romo.elems('<i class="romo-picker-caret '+caretClass+'"></i>')[0];
241
- Romo.setStyle(this.caretElem, 'line-height', parseInt(Romo.css(romoOptionListDropdownElem, "line-height"), 10)+'px');
241
+ Romo.setStyle(this.caretElem, 'line-height', Romo.css(romoOptionListDropdownElem, 'line-height'));
242
242
  Romo.on(this.caretElem, 'click', Romo.proxy(this._onCaretClick, this));
243
243
  Romo.append(romoOptionListDropdownElem, this.caretElem);
244
244
 
@@ -381,7 +381,7 @@ RomoPicker.prototype._getCaretPosition = function() {
381
381
  }
382
382
 
383
383
  RomoPicker.prototype._parseCaretWidthPx = function() {
384
- var widthPx = parseInt(Romo.css(this.caretElem, "width"), 10);
384
+ var widthPx = Romo.width(this.caretElem);
385
385
  if (isNaN(widthPx)) {
386
386
  widthPx = this.defaultCaretWidthPx;
387
387
  }
@@ -190,7 +190,7 @@ RomoSelect.prototype._buildSelectDropdownElem = function() {
190
190
  if (Romo.attr(this.elem, 'style') !== undefined) {
191
191
  Romo.setAttr(romoSelectDropdownElem, 'style', Romo.attr(this.elem, 'style'));
192
192
  }
193
- Romo.setStyle(romoSelectDropdownElem, 'width', Romo.css(this.elem, 'width'));
193
+ Romo.setStyle(romoSelectDropdownElem, 'width', Romo.width(this.elem)+'px');
194
194
  if (Romo.attr(this.elem, 'disabled') !== undefined) {
195
195
  Romo.setAttr(this.romoSelectDropdown.elem, 'disabled', Romo.attr(this.elem, 'disabled'));
196
196
  }
@@ -210,7 +210,7 @@ RomoSelect.prototype._buildSelectDropdownElem = function() {
210
210
  var caretClass = Romo.data(this.elem, 'romo-select-caret') || this.defaultCaretClass;
211
211
  if (caretClass !== undefined && caretClass !== 'none') {
212
212
  this.caretElem = Romo.elems('<i class="romo-select-caret '+caretClass+'"></i>')[0];
213
- Romo.setStyle(this.caretElem, 'line-height', parseInt(Romo.css(romoSelectDropdownElem, "line-height"), 10)+'px');
213
+ Romo.setStyle(this.caretElem, 'line-height', Romo.css(romoSelectDropdownElem, 'line-height'));
214
214
  Romo.on(this.caretElem, 'click', Romo.proxy(this._onCaretClick, this));
215
215
  Romo.append(romoSelectDropdownElem, this.caretElem);
216
216
 
@@ -312,7 +312,7 @@ RomoSelect.prototype._getCaretPosition = function() {
312
312
  }
313
313
 
314
314
  RomoSelect.prototype._parseCaretWidthPx = function() {
315
- var widthPx = parseInt(Romo.css(this.caretElem, "width"), 10);
315
+ var widthPx = Romo.width(this.caretElem);
316
316
  if (isNaN(widthPx)) {
317
317
  widthPx = this.defaultCaretWidthPx;
318
318
  }
@@ -59,7 +59,7 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
59
59
  var addElem = this._buildItemElem(addItem);
60
60
  uiListElem.append(addElem);
61
61
 
62
- var listWidth = parseInt(Romo.css(uiListElem, "width"), 10);
62
+ var listWidth = Romo.width(uiListElem);
63
63
  var listLeftPad = parseInt(Romo.css(uiListElem, "padding-left"), 10);
64
64
  var listRightPad = parseInt(Romo.css(uiListElem, "padding-right"), 10);
65
65
  var itemBorderWidth = 1;
@@ -68,14 +68,14 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
68
68
  Romo.setStyle(Romo.find(addElem, 'DIV')[0], 'max-width', String(listWidth-listLeftPad-listRightPad-(2*itemBorderWidth)-itemLeftPad-itemRightPad)+'px');
69
69
  }, this));
70
70
 
71
- var focusElemWidth = parseInt(Romo.css(this.focusElem, "width"), 10);
71
+ var focusElemWidth = Romo.width(this.focusElem);
72
72
  Romo.setStyle(this.elem, 'width', String(focusElemWidth)+'px');
73
73
 
74
74
  var maxRows = undefined;
75
- var uiListElemHeight = parseInt(Romo.css(uiListElem, "height"), 10);
75
+ var uiListElemHeight = Romo.height(uiListElem);
76
76
  var firstItemElem = Romo.find(uiListElem, '.romo-selected-options-list-item')[0];
77
77
  if (firstItemElem !== undefined) {
78
- var itemHeight = parseInt(Romo.css(firstItemElem, "height"), 10);
78
+ var itemHeight = Romo.height(firstItemElem);
79
79
  var itemMarginBottom = parseInt(Romo.css(firstItemElem, "margin-bottom"), 10);
80
80
  var itemBorderWidth = 1;
81
81
  var listTopPad = parseInt(Romo.css(uiListElem, "padding-top"), 10);
@@ -131,7 +131,7 @@ RomoSelectedOptionsList.prototype._scrollListTopToItem = function(itemElem) {
131
131
 
132
132
  var scrollOffsetTop = Romo.offset(scrollElem).top;
133
133
  var selOffsetTop = Romo.offset(itemElem).top;
134
- var selOffset = parseInt(Romo.css(itemElem, 'height'), 10) / 2;
134
+ var selOffset = Romo.height(itemElem) / 2;
135
135
 
136
136
  scrollElem.scrollTop = selOffsetTop - scrollOffsetTop - selOffset;
137
137
  }
@@ -130,7 +130,7 @@ RomoSortable.prototype.romoEvFn._onDragStart = function(e) {
130
130
  var elems = Romo.children(Romo.parent(this.draggedElem));
131
131
  this.draggedIndex = elems.indexOf(this.draggedElem);
132
132
 
133
- Romo.setStyle(this.placeholderElem, 'height', Romo.css(this.draggedElem, 'height'));
133
+ Romo.setStyle(this.placeholderElem, 'height', Romo.height(this.draggedElem)+'px');
134
134
 
135
135
  Romo.trigger(this.elem, 'romoSortable:dragStart', [this.draggedElem, this]);
136
136
  }
@@ -14,7 +14,7 @@ RomoSpinner.prototype.doStart = function(customBasisSize) {
14
14
  var basisSize = (
15
15
  customBasisSize ||
16
16
  Romo.data(this.elem, 'romo-spinner-basis-size') ||
17
- Math.min(parseInt(Romo.css(this.elem, "width"), 10), parseInt(Romo.css(this.elem, "height"), 10))
17
+ Math.min(Romo.width(this.elem), Romo.height(this.elem))
18
18
  );
19
19
 
20
20
  var spinnerOpts = {
@@ -41,8 +41,8 @@ RomoSpinner.prototype.doStart = function(customBasisSize) {
41
41
  this.elemStyle = Romo.attr(this.elem, 'style');
42
42
 
43
43
  Romo.setStyle(this.elem, 'position', 'relative');
44
- Romo.setStyle(this.elem, 'width', Romo.css(this.elem, 'width'));
45
- Romo.setStyle(this.elem, 'height', Romo.css(this.elem, 'height'));
44
+ Romo.setStyle(this.elem, 'width', Romo.width(this.elem)+'px');
45
+ Romo.setStyle(this.elem, 'height', Romo.height(this.elem)+'px');
46
46
 
47
47
  Romo.updateHtml(this.elem, '');
48
48
  this.spinner.spin(this.elem);
@@ -73,11 +73,10 @@ RomoTooltip.prototype.doPlacePopupElem = function() {
73
73
  Romo.setStyle(this.bodyElem, 'max-height', configHeight.toString() + 'px');
74
74
  }
75
75
 
76
- var elemRect = this.elem.getBoundingClientRect();
77
76
  var elemOffset = Romo.offset(this.elem);
78
77
 
79
- var elemHeight = elemRect.height;
80
- var elemWidth = elemRect.width;
78
+ var elemHeight = Romo.height(this.elem);
79
+ var elemWidth = Romo.width(this.elem);
81
80
  var elemTop = elemOffset.top;
82
81
  var elemLeft = elemOffset.left
83
82
 
@@ -163,9 +162,7 @@ RomoTooltip.prototype._bindPopup = function() {
163
162
  var popupParentElem = Romo.closest(this.elem, Romo.data(this.elem, 'romo-tooltip-append-to-closest') || 'body');
164
163
  Romo.append(popupParentElem, this.popupElem);
165
164
 
166
- this.bodyElem = Romo.children(this.popupElem).find(Romo.proxy(function(childElem){
167
- return Romo.is(childElem, '.romo-tooltip-body');
168
- }, this));
165
+ this.bodyElem = Romo.children(this.popupElem, '.romo-tooltip-body')[0];
169
166
  if (Romo.data(this.elem, 'romo-tooltip-style-class') !== undefined) {
170
167
  Romo.addClass(this.bodyElem, Romo.data(this.elem, 'romo-tooltip-style-class'));
171
168
  }
data/lib/romo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Romo
2
- VERSION = "0.20.0"
2
+ VERSION = "0.20.1"
3
3
  end
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.20.0
4
+ version: 0.20.1
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: 2017-11-17 00:00:00 Z
13
+ date: 2017-12-01 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: assert
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements: []
137
137
 
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.6
139
+ rubygems_version: 2.6.12
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: A UI Toolkit