tao_popover 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/.blade.yml +20 -3
- data/.gitignore +1 -0
- data/.travis.yml +10 -0
- data/README.md +2 -2
- data/dist/tao.js +4 -0
- data/dist/tao_popover.css +3 -0
- data/dist/tao_popover.js +48 -53
- data/index.html +16 -3
- data/lib/assets/javascripts/tao_popover/{component.coffee → element.coffee} +20 -28
- data/lib/assets/javascripts/tao_popover/position.coffee +6 -9
- data/lib/assets/javascripts/tao_popover/trigger.coffee +4 -5
- data/lib/assets/stylesheets/tao_popover.scss +4 -0
- data/lib/tao_popover/rails/engine.rb +1 -4
- data/lib/tao_popover/rails/version.rb +1 -1
- data/tao_popover.gemspec +2 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487bec5ea186f4dca5a1fb96983a4fbe1e443f72
|
4
|
+
data.tar.gz: 8583a156bf5b8e093b97b65a1209a564f8f72b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be6afa3951ada513f9e70bcc09507f14782cbf696f42c5020f4e0b96b5a93748171a629b65888acb8390489d176f69f54c60924314f961db681cb3523928211b
|
7
|
+
data.tar.gz: b972d4fd14cca6181230a4a7803e82591cf57e5f72d10bd01f9f45ed56cf8cd1be8d3c0d2f761f02288d68a9b7426a06e66f23338bf6bddd104b84b620b286ec
|
data/.blade.yml
CHANGED
@@ -5,9 +5,6 @@ load_paths:
|
|
5
5
|
- turbolinks-source: lib/assets/javascripts
|
6
6
|
- jquery-rails: vendor/assets/javascripts
|
7
7
|
- lodash-rails: vendor/assets/javascripts
|
8
|
-
- normalize-rails:
|
9
|
-
- vendor/assets/javascripts
|
10
|
-
- vendor/assets/stylesheets
|
11
8
|
- tao_on_rails:
|
12
9
|
- lib/assets/javascripts
|
13
10
|
- lib/assets/stylesheets
|
@@ -28,3 +25,23 @@ build:
|
|
28
25
|
- tao_popover.css
|
29
26
|
- tao_popover.js
|
30
27
|
path: dist
|
28
|
+
|
29
|
+
plugins:
|
30
|
+
sauce_labs:
|
31
|
+
tunnel_timeout: 120
|
32
|
+
browsers:
|
33
|
+
Google Chrome:
|
34
|
+
os: Mac, Windows
|
35
|
+
version: -2
|
36
|
+
Firefox:
|
37
|
+
os: Mac, Windows
|
38
|
+
version: -2
|
39
|
+
Safari:
|
40
|
+
platform: Mac
|
41
|
+
version: -3
|
42
|
+
Microsoft Edge:
|
43
|
+
version: -2
|
44
|
+
iPhone:
|
45
|
+
version: [9.3]
|
46
|
+
Motorola Droid 4 Emulator:
|
47
|
+
version: [5.1, 4.4]
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# TaoPopover
|
1
|
+
# TaoPopover [](https://travis-ci.org/mycolorway/tao_popover)
|
2
2
|
|
3
3
|
A popover component based on [Tao on Rails](https://github.com/mycolorway/tao_on_rails).
|
4
4
|
|
@@ -30,7 +30,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
30
30
|
|
31
31
|
## Contributing
|
32
32
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mycolorway/tao_popover. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
34
|
|
35
35
|
|
36
36
|
## License
|
data/dist/tao.js
CHANGED
@@ -31002,6 +31002,10 @@ var Deferred = void 0;
|
|
31002
31002
|
|
31003
31003
|
_Class.observedAttributes = [];
|
31004
31004
|
|
31005
|
+
_Class.get('jq', function() {
|
31006
|
+
return $(this);
|
31007
|
+
});
|
31008
|
+
|
31005
31009
|
_Class.prototype.connectedCallback = function() {
|
31006
31010
|
if (!this.initialized) {
|
31007
31011
|
this.classList.add('tao-component');
|
data/dist/tao_popover.css
CHANGED
data/dist/tao_popover.js
CHANGED
@@ -88,7 +88,7 @@
|
|
88
88
|
return Position.__super__.constructor.apply(this, arguments);
|
89
89
|
}
|
90
90
|
|
91
|
-
Position.property('direction');
|
91
|
+
Position.property('direction', 'popover', 'target');
|
92
92
|
|
93
93
|
Position.property('arrowAlign', {
|
94
94
|
"default": 'center'
|
@@ -107,9 +107,6 @@
|
|
107
107
|
Position.prototype._init = function() {
|
108
108
|
this.top = 0;
|
109
109
|
this.left = 0;
|
110
|
-
this.target = this.direction.target;
|
111
|
-
this.popover = this.direction.popover;
|
112
|
-
this.directions = this.direction.directions;
|
113
110
|
this._setPosition();
|
114
111
|
this._setArrowAlign();
|
115
112
|
return this._setOffset();
|
@@ -126,7 +123,7 @@
|
|
126
123
|
$arrow = this.popover.find('.tao-popover-arrow');
|
127
124
|
arrowWidth = $arrow.outerWidth();
|
128
125
|
arrowHeight = $arrow.outerHeight();
|
129
|
-
switch (this.
|
126
|
+
switch (this.direction[0]) {
|
130
127
|
case 'left':
|
131
128
|
this.left = targetOffset.left - popoverWidth - arrowWidth - parentOffset.left;
|
132
129
|
break;
|
@@ -139,7 +136,7 @@
|
|
139
136
|
case 'bottom':
|
140
137
|
this.top = targetOffset.top + targetHeight + arrowHeight - parentOffset.top;
|
141
138
|
}
|
142
|
-
switch (this.
|
139
|
+
switch (this.direction[1]) {
|
143
140
|
case 'top':
|
144
141
|
return this.top = targetOffset.top - popoverHeight + targetHeight / 2 + arrowHeight / 2 + this.ARROW_OFFSET - parentOffset.top;
|
145
142
|
case 'bottom':
|
@@ -156,7 +153,7 @@
|
|
156
153
|
};
|
157
154
|
|
158
155
|
Position.prototype._setArrowAlign = function() {
|
159
|
-
if (/top|bottom/.test(this.
|
156
|
+
if (/top|bottom/.test(this.direction[0])) {
|
160
157
|
switch (this.arrowAlign) {
|
161
158
|
case 'left':
|
162
159
|
this.left -= this.target.width() / 2;
|
@@ -165,7 +162,7 @@
|
|
165
162
|
this.left += this.target.width() / 2;
|
166
163
|
}
|
167
164
|
}
|
168
|
-
if (/left|right/.test(this.
|
165
|
+
if (/left|right/.test(this.direction[0])) {
|
169
166
|
switch (this.arrowVerticalAlign) {
|
170
167
|
case 'top':
|
171
168
|
return this.top -= this.target.height() / 2;
|
@@ -179,7 +176,7 @@
|
|
179
176
|
if (!this.offset) {
|
180
177
|
return;
|
181
178
|
}
|
182
|
-
switch (this.
|
179
|
+
switch (this.direction[0]) {
|
183
180
|
case 'top':
|
184
181
|
return this.top -= this.offset;
|
185
182
|
case 'bottom':
|
@@ -203,71 +200,67 @@
|
|
203
200
|
|
204
201
|
Direction = TaoPopover.Direction, Position = TaoPopover.Position;
|
205
202
|
|
206
|
-
TaoPopover.
|
207
|
-
extend(
|
203
|
+
TaoPopover.Element = (function(superClass) {
|
204
|
+
extend(Element, superClass);
|
208
205
|
|
209
|
-
function
|
210
|
-
return
|
206
|
+
function Element() {
|
207
|
+
return Element.__super__.constructor.apply(this, arguments);
|
211
208
|
}
|
212
209
|
|
213
|
-
|
210
|
+
Element.tag = 'tao-popover';
|
214
211
|
|
215
|
-
|
212
|
+
Element.count = 0;
|
216
213
|
|
217
|
-
|
214
|
+
Element.property('active', 'targetSelector', 'targetTraversal', 'boundarySelector', 'direction', 'arrowAlign', 'arrowVerticalAlign', {
|
218
215
|
observe: true
|
219
216
|
});
|
220
217
|
|
221
|
-
|
218
|
+
Element.property('offset', {
|
222
219
|
observe: true,
|
223
220
|
"default": 5
|
224
221
|
});
|
225
222
|
|
226
|
-
|
223
|
+
Element.property('autoHide', {
|
227
224
|
"default": true
|
228
225
|
});
|
229
226
|
|
230
|
-
|
227
|
+
Element.prototype._init = function() {
|
231
228
|
this.id || (this.id = "tao-popover-" + (++this.constructor.count));
|
232
|
-
return this._render;
|
229
|
+
return this._render();
|
233
230
|
};
|
234
231
|
|
235
|
-
|
236
|
-
return
|
232
|
+
Element.prototype._render = function() {
|
233
|
+
return this.jq.wrapInner('<div class="tao-popover-content">').append('<div class="tao-popover-arrow">\n <i class="arrow arrow-shadow"></i>\n <i class="arrow arrow-border"></i>\n <i class="arrow arrow-basic"></i>\n</div>');
|
237
234
|
};
|
238
235
|
|
239
|
-
|
240
|
-
this._render();
|
236
|
+
Element.prototype._connect = function() {
|
241
237
|
this._autoHideChanged();
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
Component.prototype.attributeChangedCallback = function() {
|
246
|
-
if (this._refreshing) {
|
247
|
-
return;
|
238
|
+
if (this.active) {
|
239
|
+
return this.refresh();
|
248
240
|
}
|
249
|
-
Component.__super__.attributeChangedCallback.apply(this, arguments);
|
250
|
-
return this.refresh();
|
251
241
|
};
|
252
242
|
|
253
|
-
|
254
|
-
if (this.
|
255
|
-
|
243
|
+
Element.prototype._activeChanged = function() {
|
244
|
+
if (this.active) {
|
245
|
+
this.refresh();
|
246
|
+
if (this.autoHide) {
|
256
247
|
return this._enableAutoHide();
|
257
|
-
}
|
248
|
+
}
|
249
|
+
} else {
|
250
|
+
if (this.autoHide) {
|
258
251
|
return this._disableAutoHide();
|
259
252
|
}
|
260
253
|
}
|
261
254
|
};
|
262
255
|
|
263
|
-
|
256
|
+
Element.prototype._autoHideChanged = function() {
|
264
257
|
this._disableAutoHide();
|
265
258
|
if (this.autoHide && this.active) {
|
266
259
|
return this._enableAutoHide();
|
267
260
|
}
|
268
261
|
};
|
269
262
|
|
270
|
-
|
263
|
+
Element.prototype._enableAutoHide = function() {
|
271
264
|
return $(document).on("mousedown." + this.id, (function(_this) {
|
272
265
|
return function(e) {
|
273
266
|
var target;
|
@@ -275,7 +268,7 @@
|
|
275
268
|
return;
|
276
269
|
}
|
277
270
|
target = $(e.target);
|
278
|
-
if (target.is(_this.target) ||
|
271
|
+
if (target.is(_this.target) || _this.jq.has(target).length || target.is(_this)) {
|
279
272
|
return;
|
280
273
|
}
|
281
274
|
return _this.active = false;
|
@@ -283,49 +276,49 @@
|
|
283
276
|
})(this));
|
284
277
|
};
|
285
278
|
|
286
|
-
|
279
|
+
Element.prototype._disableAutoHide = function() {
|
287
280
|
return $(document).off("mousedown." + this.id);
|
288
281
|
};
|
289
282
|
|
290
|
-
|
283
|
+
Element.prototype.refresh = function() {
|
291
284
|
var base, direction, name;
|
292
|
-
this.target = this.targetTraversal ? typeof (base =
|
293
|
-
if (!(this.target.length > 0)) {
|
285
|
+
this.target = this.targetTraversal && this.targetSelector ? typeof (base = this.jq)[name = this.targetTraversal] === "function" ? base[name](this.targetSelector) : void 0 : this.targetSelector ? $(this.targetSelector) : void 0;
|
286
|
+
if (!(this.target && this.target.length > 0)) {
|
294
287
|
return;
|
295
288
|
}
|
296
|
-
this._refreshing = true;
|
297
289
|
direction = new Direction({
|
298
|
-
popover:
|
290
|
+
popover: this.jq,
|
299
291
|
target: this.target,
|
300
292
|
boundarySelector: this.boundarySelector
|
301
293
|
});
|
302
294
|
this.direction = direction.toString();
|
303
295
|
this.position = new Position({
|
304
|
-
|
296
|
+
popover: this.jq,
|
297
|
+
target: this.target,
|
298
|
+
direction: this.direction.split('-'),
|
305
299
|
arrowAlign: this.arrowAlign,
|
306
300
|
arrowVerticalAlign: this.arrowVerticalAlign,
|
307
301
|
offset: this.offset
|
308
302
|
});
|
309
|
-
|
303
|
+
return this.jq.css({
|
310
304
|
top: this.position.top,
|
311
305
|
left: this.position.left
|
312
306
|
});
|
313
|
-
return this._refreshing = false;
|
314
307
|
};
|
315
308
|
|
316
|
-
|
309
|
+
Element.prototype.toggleActive = function() {
|
317
310
|
return this.active = !this.active;
|
318
311
|
};
|
319
312
|
|
320
|
-
|
313
|
+
Element.prototype._disconnect = function() {
|
321
314
|
return this._disableAutoHide();
|
322
315
|
};
|
323
316
|
|
324
|
-
return
|
317
|
+
return Element;
|
325
318
|
|
326
319
|
})(TaoComponent);
|
327
320
|
|
328
|
-
TaoComponent.register(TaoPopover.
|
321
|
+
TaoComponent.register(TaoPopover.Element);
|
329
322
|
|
330
323
|
}).call(this);
|
331
324
|
(function() {
|
@@ -355,11 +348,13 @@
|
|
355
348
|
if (this._popover != null) {
|
356
349
|
return this._popover;
|
357
350
|
}
|
358
|
-
this._popover =
|
351
|
+
this._popover = this.jq.children('tao-popover').get(0);
|
359
352
|
this._popover.active = false;
|
360
353
|
this._popover.autoHide = this.triggerAction === 'click';
|
361
354
|
if (!this._popover.targetSelector) {
|
362
355
|
this._popover.targetSelector = '*';
|
356
|
+
}
|
357
|
+
if (!this._popover.targetTraversal) {
|
363
358
|
this._popover.targetTraversal = 'prev';
|
364
359
|
}
|
365
360
|
return this._popover;
|
data/index.html
CHANGED
@@ -39,6 +39,12 @@
|
|
39
39
|
bottom: 20px;
|
40
40
|
right: 20px;
|
41
41
|
}
|
42
|
+
|
43
|
+
.wrapper tao-popover-trigger:nth-child(5) {
|
44
|
+
top: 50%;
|
45
|
+
left: 50%;
|
46
|
+
transform: translate(-50%, -50%);
|
47
|
+
}
|
42
48
|
</style>
|
43
49
|
|
44
50
|
<script type="text/javascript" src="dist/tao.js"></script>
|
@@ -46,7 +52,7 @@
|
|
46
52
|
|
47
53
|
</head>
|
48
54
|
<body>
|
49
|
-
|
55
|
+
<div class="wrapper">
|
50
56
|
<tao-popover-trigger>
|
51
57
|
<a href="javascript:;">click me</a>
|
52
58
|
<tao-popover boundary-selector=".wrapper">
|
@@ -69,14 +75,21 @@
|
|
69
75
|
</tao-popover-trigger>
|
70
76
|
|
71
77
|
<tao-popover-trigger trigger-action="hover">
|
78
|
+
<a href="javascript:;">hover me</a>
|
79
|
+
<tao-popover boundary-selector=".wrapper">
|
80
|
+
lalala
|
81
|
+
</tao-popover>
|
82
|
+
</tao-popover-trigger>
|
83
|
+
|
84
|
+
<tao-popover-trigger trigger-action="click">
|
72
85
|
<tao-popover boundary-selector=".wrapper" target-traversal="next" target-selector="button">
|
73
86
|
<ul>
|
74
87
|
<li>hahaha</li>
|
75
88
|
<li>lalala</li>
|
76
89
|
</ul>
|
77
90
|
</tao-popover>
|
78
|
-
<button>
|
91
|
+
<button>click me</button>
|
79
92
|
</tao-popover-trigger>
|
80
|
-
|
93
|
+
</div>
|
81
94
|
</body>
|
82
95
|
</html>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
{Direction, Position} = TaoPopover
|
5
5
|
|
6
|
-
class TaoPopover.
|
6
|
+
class TaoPopover.Element extends TaoComponent
|
7
7
|
|
8
8
|
@tag: 'tao-popover'
|
9
9
|
|
@@ -17,10 +17,10 @@ class TaoPopover.Component extends TaoComponent
|
|
17
17
|
|
18
18
|
_init: ->
|
19
19
|
@id ||= "tao-popover-#{++@constructor.count}"
|
20
|
-
@_render
|
20
|
+
@_render()
|
21
21
|
|
22
22
|
_render: ->
|
23
|
-
|
23
|
+
@jq.wrapInner '<div class="tao-popover-content">'
|
24
24
|
.append '''
|
25
25
|
<div class="tao-popover-arrow">
|
26
26
|
<i class="arrow arrow-shadow"></i>
|
@@ -30,21 +30,15 @@ class TaoPopover.Component extends TaoComponent
|
|
30
30
|
'''
|
31
31
|
|
32
32
|
_connect: ->
|
33
|
-
@_render()
|
34
33
|
@_autoHideChanged()
|
35
|
-
@refresh()
|
36
|
-
|
37
|
-
attributeChangedCallback: ->
|
38
|
-
return if @_refreshing
|
39
|
-
super
|
40
|
-
@refresh()
|
34
|
+
@refresh() if @active
|
41
35
|
|
42
36
|
_activeChanged: ->
|
43
|
-
if @
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
37
|
+
if @active
|
38
|
+
@refresh()
|
39
|
+
@_enableAutoHide() if @autoHide
|
40
|
+
else
|
41
|
+
@_disableAutoHide() if @autoHide
|
48
42
|
|
49
43
|
_autoHideChanged: ->
|
50
44
|
@_disableAutoHide()
|
@@ -54,44 +48,42 @@ class TaoPopover.Component extends TaoComponent
|
|
54
48
|
$(document).on "mousedown.#{@id}", (e) =>
|
55
49
|
return unless @active
|
56
50
|
target = $ e.target
|
57
|
-
return if target.is(@target) or
|
51
|
+
return if target.is(@target) or @jq.has(target).length or target.is(@)
|
58
52
|
@active = false
|
59
53
|
|
60
54
|
_disableAutoHide: ->
|
61
55
|
$(document).off "mousedown.#{@id}"
|
62
56
|
|
63
57
|
refresh: ->
|
64
|
-
@target = if @targetTraversal
|
65
|
-
|
66
|
-
else
|
58
|
+
@target = if @targetTraversal && @targetSelector
|
59
|
+
@jq[@targetTraversal]?(@targetSelector)
|
60
|
+
else if @targetSelector
|
67
61
|
$ @targetSelector
|
68
62
|
|
69
|
-
return unless @target.length > 0
|
70
|
-
@_refreshing = true
|
63
|
+
return unless @target && @target.length > 0
|
71
64
|
|
72
65
|
direction = new Direction
|
73
|
-
popover:
|
66
|
+
popover: @jq
|
74
67
|
target: @target
|
75
68
|
boundarySelector: @boundarySelector
|
76
|
-
|
77
69
|
@direction = direction.toString()
|
78
70
|
|
79
71
|
@position = new Position
|
80
|
-
|
72
|
+
popover: @jq
|
73
|
+
target: @target
|
74
|
+
direction: @direction.split('-')
|
81
75
|
arrowAlign: @arrowAlign
|
82
76
|
arrowVerticalAlign: @arrowVerticalAlign
|
83
77
|
offset: @offset
|
84
78
|
|
85
|
-
|
79
|
+
@jq.css
|
86
80
|
top: @position.top
|
87
81
|
left: @position.left
|
88
82
|
|
89
|
-
@_refreshing = false
|
90
|
-
|
91
83
|
toggleActive: ->
|
92
84
|
@active = !@active
|
93
85
|
|
94
86
|
_disconnect: ->
|
95
87
|
@_disableAutoHide()
|
96
88
|
|
97
|
-
TaoComponent.register TaoPopover.
|
89
|
+
TaoComponent.register TaoPopover.Element
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
class TaoPopover.Position extends TaoModule
|
3
3
|
|
4
|
-
@property 'direction'
|
4
|
+
@property 'direction', 'popover', 'target'
|
5
5
|
|
6
6
|
@property 'arrowAlign', default: 'center'
|
7
7
|
|
@@ -14,9 +14,6 @@ class TaoPopover.Position extends TaoModule
|
|
14
14
|
_init: ->
|
15
15
|
@top = 0
|
16
16
|
@left = 0
|
17
|
-
@target = @direction.target
|
18
|
-
@popover = @direction.popover
|
19
|
-
@directions = @direction.directions
|
20
17
|
|
21
18
|
@_setPosition()
|
22
19
|
@_setArrowAlign()
|
@@ -33,7 +30,7 @@ class TaoPopover.Position extends TaoModule
|
|
33
30
|
arrowWidth = $arrow.outerWidth()
|
34
31
|
arrowHeight = $arrow.outerHeight()
|
35
32
|
|
36
|
-
switch @
|
33
|
+
switch @direction[0]
|
37
34
|
when 'left'
|
38
35
|
@left = targetOffset.left - popoverWidth - arrowWidth - parentOffset.left
|
39
36
|
when 'right'
|
@@ -43,7 +40,7 @@ class TaoPopover.Position extends TaoModule
|
|
43
40
|
when 'bottom'
|
44
41
|
@top = targetOffset.top + targetHeight + arrowHeight - parentOffset.top
|
45
42
|
|
46
|
-
switch @
|
43
|
+
switch @direction[1]
|
47
44
|
when 'top'
|
48
45
|
@top = targetOffset.top - popoverHeight + targetHeight / 2 + arrowHeight / 2 + @ARROW_OFFSET - parentOffset.top
|
49
46
|
when 'bottom'
|
@@ -58,14 +55,14 @@ class TaoPopover.Position extends TaoModule
|
|
58
55
|
@top = targetOffset.top + targetHeight / 2 - popoverHeight / 2 - parentOffset.top
|
59
56
|
|
60
57
|
_setArrowAlign: ->
|
61
|
-
if /top|bottom/.test @
|
58
|
+
if /top|bottom/.test @direction[0]
|
62
59
|
switch @arrowAlign
|
63
60
|
when 'left'
|
64
61
|
@left -= @target.width() / 2
|
65
62
|
when 'right'
|
66
63
|
@left += @target.width() / 2
|
67
64
|
|
68
|
-
if /left|right/.test @
|
65
|
+
if /left|right/.test @direction[0]
|
69
66
|
switch @arrowVerticalAlign
|
70
67
|
when 'top'
|
71
68
|
@top -= @target.height() / 2
|
@@ -75,7 +72,7 @@ class TaoPopover.Position extends TaoModule
|
|
75
72
|
_setOffset: ->
|
76
73
|
return unless @offset
|
77
74
|
|
78
|
-
switch @
|
75
|
+
switch @direction[0]
|
79
76
|
when 'top'
|
80
77
|
@top -= @offset
|
81
78
|
when 'bottom'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#= require ./
|
1
|
+
#= require ./element
|
2
2
|
|
3
3
|
class TaoPopover.Trigger extends TaoComponent
|
4
4
|
|
@@ -11,13 +11,12 @@ class TaoPopover.Trigger extends TaoComponent
|
|
11
11
|
@get 'popover', ->
|
12
12
|
return @_popover if @_popover?
|
13
13
|
|
14
|
-
@_popover =
|
14
|
+
@_popover = @jq.children('tao-popover').get(0)
|
15
15
|
@_popover.active = false
|
16
16
|
@_popover.autoHide = @triggerAction == 'click'
|
17
17
|
|
18
|
-
unless @_popover.targetSelector
|
19
|
-
|
20
|
-
@_popover.targetTraversal = 'prev'
|
18
|
+
@_popover.targetSelector = '*' unless @_popover.targetSelector
|
19
|
+
@_popover.targetTraversal = 'prev' unless @_popover.targetTraversal
|
21
20
|
@_popover
|
22
21
|
|
23
22
|
_connect: ->
|
data/tao_popover.gemspec
CHANGED
@@ -21,10 +21,11 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_runtime_dependency "tao_on_rails", '~> 0.4.
|
24
|
+
spec.add_runtime_dependency "tao_on_rails", '~> 0.4.4'
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.13"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "minitest", "~> 5.0"
|
29
29
|
spec.add_development_dependency "blade", "~> 0.7.0"
|
30
|
+
spec.add_development_dependency "blade-sauce_labs_plugin", "~> 0.6.2"
|
30
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tao_popover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- farthinker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tao_on_rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.7.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: blade-sauce_labs_plugin
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.6.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.6.2
|
83
97
|
description: A popover component based on Tao Framework.
|
84
98
|
email:
|
85
99
|
- farthinker@gmail.com
|
@@ -89,6 +103,7 @@ extra_rdoc_files: []
|
|
89
103
|
files:
|
90
104
|
- ".blade.yml"
|
91
105
|
- ".gitignore"
|
106
|
+
- ".travis.yml"
|
92
107
|
- CODE_OF_CONDUCT.md
|
93
108
|
- Gemfile
|
94
109
|
- LICENSE
|
@@ -103,8 +118,8 @@ files:
|
|
103
118
|
- dist/tao_popover.js
|
104
119
|
- index.html
|
105
120
|
- lib/assets/javascripts/tao_popover.coffee
|
106
|
-
- lib/assets/javascripts/tao_popover/component.coffee
|
107
121
|
- lib/assets/javascripts/tao_popover/direction.coffee
|
122
|
+
- lib/assets/javascripts/tao_popover/element.coffee
|
108
123
|
- lib/assets/javascripts/tao_popover/position.coffee
|
109
124
|
- lib/assets/javascripts/tao_popover/trigger.coffee
|
110
125
|
- lib/assets/stylesheets/tao_popover.scss
|