flashgrid 2.2.6 → 2.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35b7903baa05a83fc6a7bdd5752fed20407f55bf
4
- data.tar.gz: f9b55aa86d6ebf0a82fd907a1b0b83c12e4707cd
3
+ metadata.gz: b7fb62622ccdd9b4141156f9da5aa2f5a31c5c85
4
+ data.tar.gz: 7a816bbe7cbc620f48981744186fdfb5e52bfe66
5
5
  SHA512:
6
- metadata.gz: c8a4228224ddecb3f345a408fa54c813d7067fc75239054b4392a130119f6e178701d59c0f853110912f2b366c69bdc67cecd4245402a6efa49e0252b213d9a4
7
- data.tar.gz: 5d52bce35a67e4740d2f2d6d35ca79b032c16fc6da7ea8803ba266f93b08d1813f8762e845fe6d70f81f8599a120c8cc5e4f86d1d481d4c5f83b28021716fe1d
6
+ metadata.gz: f7480299fdecde9eac5e61ed6f550840474d0e521b6babf2fcbf8b2b2c07fb03d7d1b3c37f54555b54c763c9b348a4d1febaa3575ee1ddc19f779e33392d495f
7
+ data.tar.gz: 6b8bf5382e21b8b13a1b1ff4860959181ce58679eba9ba399da6f167849b1dfaf4a7ceb827a58762163f816f581b529234bb9360ec1b12e0afc7303342ef08c4
@@ -1,3 +1,3 @@
1
1
  module Flashgrid
2
- VERSION = "2.2.6"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -11,6 +11,8 @@
11
11
 
12
12
  Alert.VERSION = '3.2.0'
13
13
 
14
+ Alert.TRANSITION_DURATION = 150
15
+
14
16
  Alert.prototype.close = function (e) {
15
17
  var $this = $(this)
16
18
  var selector = $this.attr('data-target')
@@ -25,7 +27,7 @@
25
27
  if (e) e.preventDefault()
26
28
 
27
29
  if (!$parent.length) {
28
- $parent = $this.hasClass('alert') ? $this : $this.parent()
30
+ $parent = $this.closest('.alert')
29
31
  }
30
32
 
31
33
  $parent.trigger(e = $.Event('close.bs.alert'))
@@ -42,7 +44,7 @@
42
44
  $.support.transition && $parent.hasClass('fade') ?
43
45
  $parent
44
46
  .one('bsTransitionEnd', removeElement)
45
- .emulateTransitionEnd(150) :
47
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
46
48
  removeElement()
47
49
  }
48
50
 
@@ -21,6 +21,8 @@
21
21
 
22
22
  Carousel.VERSION = '3.2.0'
23
23
 
24
+ Carousel.TRANSITION_DURATION = 600
25
+
24
26
  Carousel.DEFAULTS = {
25
27
  interval: 5000,
26
28
  pause: 'hover',
@@ -54,6 +56,13 @@
54
56
  return this.$items.index(item || this.$active)
55
57
  }
56
58
 
59
+ Carousel.prototype.getItemForDirection = function (direction, active) {
60
+ var delta = direction == 'prev' ? -1 : 1
61
+ var activeIndex = this.getItemIndex(active)
62
+ var itemIndex = (activeIndex + delta) % this.$items.length
63
+ return this.$items.eq(itemIndex)
64
+ }
65
+
57
66
  Carousel.prototype.to = function (pos) {
58
67
  var that = this
59
68
  var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
@@ -63,7 +72,7 @@
63
72
  if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
64
73
  if (activeIndex == pos) return this.pause().cycle()
65
74
 
66
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
75
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
67
76
  }
68
77
 
69
78
  Carousel.prototype.pause = function (e) {
@@ -91,7 +100,7 @@
91
100
 
92
101
  Carousel.prototype.slide = function (type, next) {
93
102
  var $active = this.$element.find('.item.active')
94
- var $next = next || $active[type]()
103
+ var $next = next || this.getItemForDirection(type, $active)
95
104
  var isCycling = this.interval
96
105
  var direction = type == 'next' ? 'left' : 'right'
97
106
  var fallback = type == 'next' ? 'first' : 'last'
@@ -137,7 +146,7 @@
137
146
  that.$element.trigger(slidEvent)
138
147
  }, 0)
139
148
  })
140
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
149
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
141
150
  } else {
142
151
  $active.removeClass('active')
143
152
  $next.addClass('active')
@@ -15,6 +15,8 @@
15
15
 
16
16
  Collapse.VERSION = '3.2.0'
17
17
 
18
+ Collapse.TRANSITION_DURATION = 350
19
+
18
20
  Collapse.DEFAULTS = {
19
21
  toggle: true
20
22
  }
@@ -63,7 +65,7 @@
63
65
 
64
66
  this.$element
65
67
  .one('bsTransitionEnd', $.proxy(complete, this))
66
- .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
68
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
67
69
  }
68
70
 
69
71
  Collapse.prototype.hide = function () {
@@ -96,7 +98,7 @@
96
98
  this.$element
97
99
  [dimension](0)
98
100
  .one('bsTransitionEnd', $.proxy(complete, this))
99
- .emulateTransitionEnd(350)
101
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
100
102
  }
101
103
 
102
104
  Collapse.prototype.toggle = function () {
@@ -113,7 +115,7 @@
113
115
  var data = $this.data('bs.collapse')
114
116
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
115
117
 
116
- if (!data && options.toggle && option == 'show') option = !option
118
+ if (!data && options.toggle && option == 'show') options.toggle = false
117
119
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
118
120
  if (typeof option == 'string') data[option]()
119
121
  })
@@ -23,6 +23,9 @@
23
23
 
24
24
  Modal.VERSION = '3.2.0'
25
25
 
26
+ Modal.TRANSITION_DURATION = 300
27
+ Modal.BACKDROP_TRANSITION_DURATION = 150
28
+
26
29
  Modal.DEFAULTS = {
27
30
  backdrop: true,
28
31
  keyboard: true,
@@ -79,7 +82,7 @@
79
82
  .one('bsTransitionEnd', function () {
80
83
  that.$element.trigger('focus').trigger(e)
81
84
  })
82
- .emulateTransitionEnd(300) :
85
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
83
86
  that.$element.trigger('focus').trigger(e)
84
87
  })
85
88
  }
@@ -110,7 +113,7 @@
110
113
  $.support.transition && this.$element.hasClass('fade') ?
111
114
  this.$element
112
115
  .one('bsTransitionEnd', $.proxy(this.hideModal, this))
113
- .emulateTransitionEnd(300) :
116
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
114
117
  this.hideModal()
115
118
  }
116
119
 
@@ -173,7 +176,7 @@
173
176
  doAnimate ?
174
177
  this.$backdrop
175
178
  .one('bsTransitionEnd', callback)
176
- .emulateTransitionEnd(150) :
179
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
177
180
  callback()
178
181
 
179
182
  } else if (!this.isShown && this.$backdrop) {
@@ -186,7 +189,7 @@
186
189
  $.support.transition && this.$element.hasClass('fade') ?
187
190
  this.$backdrop
188
191
  .one('bsTransitionEnd', callbackRemove)
189
- .emulateTransitionEnd(150) :
192
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
190
193
  callbackRemove()
191
194
 
192
195
  } else if (callback) {
@@ -37,7 +37,7 @@
37
37
  var content = this.getContent()
38
38
 
39
39
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
40
- $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
40
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
41
41
  this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
42
42
  ](content)
43
43
 
@@ -10,6 +10,8 @@
10
10
 
11
11
  Tab.VERSION = '3.2.0'
12
12
 
13
+ Tab.TRANSITION_DURATION = 150
14
+
13
15
  Tab.prototype.show = function () {
14
16
  var $this = this.element
15
17
  var $ul = $this.closest('ul:not(.dropdown-menu)')
@@ -73,7 +75,7 @@
73
75
  $active.length && transition ?
74
76
  $active
75
77
  .one('bsTransitionEnd', next)
76
- .emulateTransitionEnd(150) :
78
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
77
79
  next()
78
80
 
79
81
  $active.removeClass('in')
@@ -17,6 +17,8 @@
17
17
 
18
18
  Tooltip.VERSION = '3.2.0'
19
19
 
20
+ Tooltip.TRANSITION_DURATION = 150
21
+
20
22
  Tooltip.DEFAULTS = {
21
23
  animation: true,
22
24
  placement: 'top',
@@ -197,7 +199,7 @@
197
199
  $.support.transition && this.$tip.hasClass('fade') ?
198
200
  $tip
199
201
  .one('bsTransitionEnd', complete)
200
- .emulateTransitionEnd(150) :
202
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
201
203
  complete()
202
204
  }
203
205
  }
@@ -285,7 +287,7 @@
285
287
  $.support.transition && this.$tip.hasClass('fade') ?
286
288
  $tip
287
289
  .one('bsTransitionEnd', complete)
288
- .emulateTransitionEnd(150) :
290
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
289
291
  complete()
290
292
 
291
293
  this.hoverState = null
@@ -311,7 +313,7 @@
311
313
  var isBody = el.tagName == 'BODY'
312
314
  var isSvg = window.SVGElement && el instanceof window.SVGElement
313
315
 
314
- var elRect = el.getBoundingClientRect ? el.getBoundingClientRect() : null
316
+ var elRect = el.getBoundingClientRect()
315
317
  var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
316
318
  var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
317
319
  var outerDims = isSvg ? {} : {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flashgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez