romo 0.20.10 → 0.20.11

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.
@@ -65,7 +65,11 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
65
65
  var itemBorderWidth = 1;
66
66
  var itemLeftPad = parseInt(Romo.css(addElem, "padding-left"), 10);
67
67
  var itemRightPad = parseInt(Romo.css(addElem, "padding-right"), 10);
68
- Romo.setStyle(Romo.find(addElem, 'DIV')[0], 'max-width', String(listWidth-listLeftPad-listRightPad-(2*itemBorderWidth)-itemLeftPad-itemRightPad)+'px');
68
+ Romo.setStyle(
69
+ Romo.find(addElem, 'DIV')[0],
70
+ 'max-width',
71
+ String(listWidth-listLeftPad-listRightPad-(2*itemBorderWidth)-itemLeftPad-itemRightPad)+'px'
72
+ );
69
73
  }, this));
70
74
 
71
75
  var focusElemWidth = Romo.width(this.focusElem);
@@ -82,7 +86,14 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
82
86
  var listBottomPad = parseInt(Romo.css(uiListElem, "padding-bottom"), 10);
83
87
 
84
88
  var maxRows = Romo.data(this.focusElem, 'romo-selected-options-list-max-rows') || 0;
85
- var maxHeight = listTopPad+(itemHeight*maxRows)+(itemMarginBottom*(maxRows-1))+(2*itemBorderWidth*maxRows)+listBottomPad+(itemHeight/2);
89
+ var maxHeight = (
90
+ listTopPad+
91
+ (itemHeight*maxRows)+
92
+ (itemMarginBottom*(maxRows-1))+
93
+ (2*itemBorderWidth*maxRows)+
94
+ listBottomPad+
95
+ (itemHeight/2)
96
+ );
86
97
  }
87
98
  if (maxRows !== 0 && (uiListElemHeight > maxHeight)) {
88
99
  Romo.setStyle(this.elem, 'height', String(maxHeight)+'px');
@@ -100,7 +111,11 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
100
111
  // private
101
112
 
102
113
  RomoSelectedOptionsList.prototype._bindElem = function() {
103
- this.elem = Romo.elems('<div class="romo-selected-options-list"><div class="romo-selected-options-list-items"></div></div>')[0];
114
+ this.elem = Romo.elems(
115
+ '<div class="romo-selected-options-list">'+
116
+ '<div class="romo-selected-options-list-items"></div>'+
117
+ '</div>'
118
+ )[0];
104
119
 
105
120
  Romo.on(this.elem, 'click', Romo.proxy(function(e) {
106
121
  Romo.trigger(this.elem, 'romoSelectedOptionsList:listClick', [this]);
@@ -112,8 +127,20 @@ RomoSelectedOptionsList.prototype._bindElem = function() {
112
127
 
113
128
  RomoSelectedOptionsList.prototype._buildItemElem = function(item) {
114
129
  var itemClass = Romo.data(this.focusElem, 'romo-selected-options-list-item-class') || '';
115
- var itemElem = Romo.elems('<div class="romo-selected-options-list-item romo-pointer romo-pad0-left romo-pad0-right romo-push0-right romo-push0-bottom '+itemClass+'"></div>')[0];
116
- Romo.append(itemElem, Romo.elems('<div class="romo-crop-ellipsis romo-text-strikethrough-hover">'+(item.displayText || '')+'</div>')[0]);
130
+ var itemElem = Romo.elems(
131
+ '<div class="romo-selected-options-list-item romo-pointer '+
132
+ 'romo-pad0-left romo-pad0-right romo-push0-right romo-push0-bottom '+
133
+ itemClass+'">'+
134
+ '</div>'
135
+ )[0];
136
+ Romo.append(
137
+ itemElem,
138
+ Romo.elems(
139
+ '<div class="romo-crop-ellipsis romo-text-strikethrough-hover">'+
140
+ (item.displayText || '')+
141
+ '</div>'
142
+ )[0]
143
+ );
117
144
  Romo.setData(itemElem, 'romo-selected-options-list-value', (item.value || ''));
118
145
  Romo.on(itemElem, 'click', Romo.proxy(this._onItemClick, this));
119
146
 
@@ -158,8 +158,22 @@ RomoTooltip.prototype._bindElem = function() {
158
158
  }
159
159
 
160
160
  RomoTooltip.prototype._bindPopup = function() {
161
- this.popupElem = Romo.elems('<div class="romo-tooltip-popup"><div class="romo-tooltip-arrow"></div><div class="romo-tooltip-body"></div></div>')[0];
162
- var popupParentElem = Romo.closest(this.elem, Romo.data(this.elem, 'romo-tooltip-append-to-closest') || 'body');
161
+ this.popupElem = Romo.elems(
162
+ '<div class="romo-tooltip-popup">' +
163
+ '<div class="romo-tooltip-arrow"></div>' +
164
+ '<div class="romo-tooltip-body"></div>' +
165
+ '</div>'
166
+ )[0];
167
+
168
+ var popupParentElem;
169
+ var appendToClosestSel = Romo.data(this.elem, 'romo-tooltip-append-to-closest');
170
+ if (appendToClosestSel !== undefined) {
171
+ popupParentElem = Romo.closest(this.elem, appendToClosestSel);
172
+ } else {
173
+ popupParentElem = Romo.f(
174
+ Romo.data(this.elem, 'romo-tooltip-append-to') || 'BODY'
175
+ )[0];
176
+ }
163
177
  Romo.append(popupParentElem, this.popupElem);
164
178
 
165
179
  this.bodyElem = Romo.children(this.popupElem, '.romo-tooltip-body')[0];
@@ -1,14 +1,14 @@
1
- var RomoWordBoundaryFilter = function(filterString, setElems, getElemTextContentCallback) {
1
+ var RomoWordBoundaryFilter = function(filterString, setItems, getItemTextContentCallback) {
2
2
  this.boundaryCharsRegex = /[\s-_]+/;
3
- this.matchingElems = [];
4
- this.notMatchingElems = [];
3
+ this.matchingItems = [];
4
+ this.notMatchingItems = [];
5
5
  this.filters = filterString
6
6
  .trim()
7
7
  .toLowerCase()
8
8
  .split(this.boundaryCharsRegex);
9
9
 
10
- Romo.array(setElems).forEach(Romo.proxy(function(elem) {
11
- var contentStack = getElemTextContentCallback(elem)
10
+ Romo.array(setItems).forEach(Romo.proxy(function(item) {
11
+ var contentStack = getItemTextContentCallback(item)
12
12
  .trim()
13
13
  .toLowerCase()
14
14
  .split(this.boundaryCharsRegex).reverse();
@@ -33,9 +33,13 @@ var RomoWordBoundaryFilter = function(filterString, setElems, getElemTextContent
33
33
  }, this), true);
34
34
 
35
35
  if (match === true) {
36
- this.matchingElems.push(elem);
36
+ this.matchingItems.push(item);
37
37
  } else {
38
- this.notMatchingElems.push(elem);
38
+ this.notMatchingItems.push(item);
39
39
  }
40
40
  }, this));
41
+
42
+ // TODO: backwards compatible, remove later on
43
+ this.matchingElems = this.matchingItems;
44
+ this.notMatchingElems = this.notMatchingItems;
41
45
  }
@@ -38,6 +38,7 @@ module Romo::Dassets
38
38
  'css/romo/indicator_text_input.css',
39
39
  'css/romo/select.css',
40
40
  'css/romo/picker.css',
41
+ 'css/romo/color_select.css',
41
42
  'css/romo/datepicker.css',
42
43
  'css/romo/tooltip.css',
43
44
  'css/romo/sortable.css',
@@ -61,6 +62,7 @@ module Romo::Dassets
61
62
  'js/romo/select_dropdown.js',
62
63
  'js/romo/select.js',
63
64
  'js/romo/picker.js',
65
+ 'js/romo/color_select.js',
64
66
  'js/romo/datepicker.js',
65
67
  'js/romo/inline.js',
66
68
  'js/romo/inline_form.js',
@@ -1,3 +1,3 @@
1
1
  module Romo
2
- VERSION = "0.20.10"
2
+ VERSION = "0.20.11"
3
3
  end
@@ -44,6 +44,7 @@ module Romo::Dassets
44
44
  'css/romo/indicator_text_input.css',
45
45
  'css/romo/select.css',
46
46
  'css/romo/picker.css',
47
+ 'css/romo/color_select.css',
47
48
  'css/romo/datepicker.css',
48
49
  'css/romo/tooltip.css',
49
50
  'css/romo/sortable.css',
@@ -69,6 +70,7 @@ module Romo::Dassets
69
70
  'js/romo/select_dropdown.js',
70
71
  'js/romo/select.js',
71
72
  'js/romo/picker.js',
73
+ 'js/romo/color_select.js',
72
74
  'js/romo/datepicker.js',
73
75
  'js/romo/inline.js',
74
76
  'js/romo/inline_form.js',
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.10
4
+ version: 0.20.11
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: 2018-01-18 00:00:00 Z
13
+ date: 2018-03-09 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: assert
@@ -61,6 +61,7 @@ files:
61
61
  - assets/css/romo/_vars.scss
62
62
  - assets/css/romo/base.scss
63
63
  - assets/css/romo/buttons.scss
64
+ - assets/css/romo/color_select.scss
64
65
  - assets/css/romo/colors.scss
65
66
  - assets/css/romo/datepicker.scss
66
67
  - assets/css/romo/dropdown.scss
@@ -81,6 +82,7 @@ files:
81
82
  - assets/css/romo/z_index.scss
82
83
  - assets/js/romo/ajax.js
83
84
  - assets/js/romo/base.js
85
+ - assets/js/romo/color_select.js
84
86
  - assets/js/romo/currency.js
85
87
  - assets/js/romo/currency_text_input.js
86
88
  - assets/js/romo/date.js