flashgrid 3.2.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@
15
15
  this.init('tooltip', element, options)
16
16
  }
17
17
 
18
- Tooltip.VERSION = '3.2.0'
18
+ Tooltip.VERSION = '3.3.0'
19
19
 
20
20
  Tooltip.TRANSITION_DURATION = 150
21
21
 
@@ -178,13 +178,13 @@
178
178
 
179
179
  if (autoPlace) {
180
180
  var orgPlacement = placement
181
- var $parent = this.$element.parent()
182
- var parentDim = this.getPosition($parent)
181
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
182
+ var containerDim = this.getPosition($container)
183
183
 
184
- placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
185
- placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
186
- placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
187
- placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
184
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
185
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
186
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
187
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
188
188
  placement
189
189
 
190
190
  $tip
@@ -197,8 +197,11 @@
197
197
  this.applyPlacement(calculatedOffset, placement)
198
198
 
199
199
  var complete = function () {
200
+ var prevHoverState = that.hoverState
200
201
  that.$element.trigger('shown.bs.' + that.type)
201
202
  that.hoverState = null
203
+
204
+ if (prevHoverState == 'out') that.leave(that)
202
205
  }
203
206
 
204
207
  $.support.transition && this.$tip.hasClass('fade') ?
@@ -319,7 +322,6 @@
319
322
 
320
323
  var el = $element[0]
321
324
  var isBody = el.tagName == 'BODY'
322
- var isSvg = window.SVGElement && el instanceof window.SVGElement
323
325
 
324
326
  var elRect = el.getBoundingClientRect()
325
327
  if (elRect.width == null) {
@@ -328,10 +330,7 @@
328
330
  }
329
331
  var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
330
332
  var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
331
- var outerDims = isSvg ? {} : {
332
- width: isBody ? $(window).width() : $element.outerWidth(),
333
- height: isBody ? $(window).height() : $element.outerHeight()
334
- }
333
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
335
334
 
336
335
  return $.extend({}, elRect, scroll, outerDims, elOffset)
337
336
  }
@@ -397,14 +396,6 @@
397
396
  return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
398
397
  }
399
398
 
400
- Tooltip.prototype.validate = function () {
401
- if (!this.$element[0].parentNode) {
402
- this.hide()
403
- this.$element = null
404
- this.options = null
405
- }
406
- }
407
-
408
399
  Tooltip.prototype.enable = function () {
409
400
  this.enabled = true
410
401
  }
@@ -444,12 +435,18 @@
444
435
 
445
436
  function Plugin(option) {
446
437
  return this.each(function () {
447
- var $this = $(this)
448
- var data = $this.data('bs.tooltip')
449
- var options = typeof option == 'object' && option
438
+ var $this = $(this)
439
+ var data = $this.data('bs.tooltip')
440
+ var options = typeof option == 'object' && option
441
+ var selector = options && options.selector
450
442
 
451
443
  if (!data && option == 'destroy') return
452
- if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
444
+ if (selector) {
445
+ if (!data) $this.data('bs.tooltip', (data = {}))
446
+ if (!data[selector]) data[selector] = new Tooltip(this, options)
447
+ } else {
448
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
449
+ }
453
450
  if (typeof option == 'string') data[option]()
454
451
  })
455
452
  }
@@ -9,6 +9,8 @@
9
9
  animation-duration: 1s;
10
10
  -webkit-animation-fill-mode: both;
11
11
  animation-fill-mode: both;
12
+ position: relative;
13
+ z-index: 1;
12
14
  }
13
15
  .animated.hinge {
14
16
  -webkit-animation-duration: 2s;
@@ -51,11 +53,11 @@
51
53
  }
52
54
  @-webkit-keyframes flash {
53
55
  0%, 50%, 100% { opacity: 1; }
54
- 25%, 75% { opacity: 0; }
56
+ 25%, 75% { opacity: 0; }
55
57
  }
56
58
  @keyframes flash {
57
59
  0%, 50%, 100% { opacity: 1; }
58
- 25%, 75% { opacity: 0; }
60
+ 25%, 75% { opacity: 0; }
59
61
  }
60
62
  .flash {
61
63
  -webkit-animation-name: flash;
@@ -1013,11 +1015,11 @@
1013
1015
  animation-name: fadeInUpBig;
1014
1016
  }
1015
1017
  @-webkit-keyframes fadeOut {
1016
- 0% { opacity: 1; }
1018
+ 0% { opacity: 1; }
1017
1019
  100% { opacity: 0; }
1018
1020
  }
1019
1021
  @keyframes fadeOut {
1020
- 0% { opacity: 1; }
1022
+ 0% { opacity: 1; }
1021
1023
  100% { opacity: 0; }
1022
1024
  }
1023
1025
  .fadeOut {
@@ -1,11 +1,11 @@
1
1
  /* Table of Contents
2
2
  ==================================================
3
- #Switch */
3
+ #Swoggle */
4
4
 
5
- /* #Switch
5
+ /* #Swoggle
6
6
  ================================================== */
7
- .switch input[type='radio'],
8
- .switch input[type='checkbox'] {
7
+ .swoggle input[type='radio'],
8
+ .swoggle input[type='checkbox'] {
9
9
  left: 0;
10
10
  opacity: 0;
11
11
  filter: alpha(opacity=0);
@@ -13,7 +13,7 @@
13
13
  top: 0;
14
14
  z-index: -1;
15
15
  }
16
- .switch {
16
+ .swoggle {
17
17
  background: rgba(245,248,250,1);
18
18
  border: 1px solid rgba(225,232,237,1);
19
19
  border-radius: 500px;
@@ -38,8 +38,8 @@
38
38
  user-select: none;
39
39
  vertical-align: middle;
40
40
  }
41
- .switch span,
42
- .switch label {
41
+ .swoggle span,
42
+ .swoggle label {
43
43
  -webkit-box-sizing: border-box;
44
44
  box-sizing: border-box;
45
45
  cursor: pointer;
@@ -47,7 +47,7 @@
47
47
  height: 100%;
48
48
  position: relative;
49
49
  }
50
- .switch label {
50
+ .swoggle label {
51
51
  background: rgba(255,255,255,1);
52
52
  border-radius: 500px;
53
53
  margin-bottom: 0;
@@ -59,7 +59,7 @@
59
59
  width: 20%;
60
60
  z-index: 100;
61
61
  }
62
- .switch span {
62
+ .swoggle span {
63
63
  padding-bottom: 0;
64
64
  padding-top: 0;
65
65
  text-align: center;
@@ -67,7 +67,7 @@
67
67
  width: 40%;
68
68
  z-index: 1;
69
69
  }
70
- .switch > div {
70
+ .swoggle > div {
71
71
  display: inline-block;
72
72
  position: relative;
73
73
  -webkit-transform: translate3d(0,0,0);
@@ -75,34 +75,34 @@
75
75
  top: 0;
76
76
  width: 150%;
77
77
  }
78
- .switch.switch-on > div { margin-left: 0; }
79
- .switch.switch-off > div { margin-left: -50%; }
80
- .switch.switch-on.switch-black,
81
- .switch.switch-on.switch-blue,
82
- .switch.switch-on.switch-green,
83
- .switch.switch-on.switch-red { color: rgba(255,255,255,1); }
84
- .switch.switch-on.switch-black {
78
+ .swoggle.swoggle-on > div { margin-left: 0; }
79
+ .swoggle.swoggle-off > div { margin-left: -50%; }
80
+ .swoggle.swoggle-on.swoggle-black,
81
+ .swoggle.swoggle-on.swoggle-blue,
82
+ .swoggle.swoggle-on.swoggle-green,
83
+ .swoggle.swoggle-on.swoggle-red { color: rgba(255,255,255,1); }
84
+ .swoggle.swoggle-on.swoggle-black {
85
85
  background: rgba(56,67,81,1);
86
86
  border-color: rgba(6,17,31,1);
87
87
  }
88
- .switch.switch-on.switch-blue {
88
+ .swoggle.swoggle-on.swoggle-blue {
89
89
  background: rgba(15,135,226,1);
90
90
  border-color: rgba(0,120,211,1);
91
91
  }
92
- .switch.switch-on.switch-green {
92
+ .swoggle.swoggle-on.swoggle-green {
93
93
  background: rgba(112,169,13,1);
94
94
  border-color: rgba(74,153,0,1);
95
95
  }
96
- .switch.switch-on.switch-red {
96
+ .swoggle.swoggle-on.swoggle-red {
97
97
  background: rgba(218,79,46,1);
98
98
  border-color: rgba(188,49,16,1);
99
99
  }
100
- .switch.switch-animate > div {
100
+ .swoggle.swoggle-animate > div {
101
101
  -webkit-transition: margin-left 0.5s;
102
102
  transition: margin-left 0.5s;
103
103
  }
104
- .switch.switch-disabled,
105
- .switch.switch-readonly {
104
+ .swoggle.swoggle-disabled,
105
+ .swoggle.swoggle-readonly {
106
106
  cursor: default !important;
107
107
  opacity: 0.5;
108
108
  filter: alpha(opacity=50);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flashgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,7 +89,7 @@ files:
89
89
  - vendor/assets/javascripts/modal.js
90
90
  - vendor/assets/javascripts/popover.js
91
91
  - vendor/assets/javascripts/scrollspy.js
92
- - vendor/assets/javascripts/switch.js
92
+ - vendor/assets/javascripts/swoggle.js
93
93
  - vendor/assets/javascripts/tab.js
94
94
  - vendor/assets/javascripts/tablespy.js
95
95
  - vendor/assets/javascripts/time_picker.js
@@ -125,7 +125,7 @@ files:
125
125
  - vendor/assets/stylesheets/progress.css.scss
126
126
  - vendor/assets/stylesheets/reset.css.scss
127
127
  - vendor/assets/stylesheets/spinner.css.scss
128
- - vendor/assets/stylesheets/switch.css.scss
128
+ - vendor/assets/stylesheets/swoggle.css.scss
129
129
  - vendor/assets/stylesheets/table.css.scss
130
130
  - vendor/assets/stylesheets/timepicker.css.scss
131
131
  - vendor/assets/stylesheets/tooltip.css.scss