flashgrid 2.0.1 → 2.1.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.
@@ -10,7 +10,7 @@
10
10
 
11
11
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
12
12
 
13
- Popover.VERSION = '3.1.1'
13
+ Popover.VERSION = '3.2.0'
14
14
 
15
15
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
16
16
  placement: 'right',
@@ -63,7 +63,7 @@
63
63
  }
64
64
 
65
65
  Popover.prototype.arrow = function () {
66
- return this.$arrow = this.$arrow || this.tip().find('.arrow')
66
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
67
67
  }
68
68
 
69
69
  Popover.prototype.tip = function () {
@@ -5,41 +5,49 @@
5
5
  // ==========================
6
6
 
7
7
  function ScrollSpy(element, options) {
8
- var href
9
8
  var process = $.proxy(this.process, this)
10
9
 
11
- this.$element = $(element).is('body') ? $(window) : $(element)
12
10
  this.$body = $('body')
13
- this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
11
+ this.$scrollElement = $(element).is('body') ? $(window) : $(element)
14
12
  this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
15
- this.selector = (this.options.target
16
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
17
- || '') + ' .nav li > a'
18
- this.offsets = $([])
19
- this.targets = $([])
13
+ this.selector = (this.options.target || '') + ' .nav li > a'
14
+ this.offsets = []
15
+ this.targets = []
20
16
  this.activeTarget = null
17
+ this.scrollHeight = 0
21
18
 
19
+ this.$scrollElement.on('scroll.bs.scrollspy', process)
22
20
  this.refresh()
23
21
  this.process()
24
22
  }
25
23
 
26
- ScrollSpy.VERSION = '3.1.1'
24
+ ScrollSpy.VERSION = '3.2.0'
27
25
 
28
26
  ScrollSpy.DEFAULTS = {
29
27
  offset: 10
30
28
  }
31
29
 
30
+ ScrollSpy.prototype.getScrollHeight = function () {
31
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
32
+ }
33
+
32
34
  ScrollSpy.prototype.refresh = function () {
33
- var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
35
+ var offsetMethod = 'offset'
36
+ var offsetBase = 0
37
+
38
+ if (!$.isWindow(this.$scrollElement[0])) {
39
+ offsetMethod = 'position'
40
+ offsetBase = this.$scrollElement.scrollTop()
41
+ }
34
42
 
35
- this.offsets = $([])
36
- this.targets = $([])
43
+ this.offsets = []
44
+ this.targets = []
45
+ this.scrollHeight = this.getScrollHeight()
37
46
 
38
47
  var self = this
39
48
 
40
49
  this.$body
41
50
  .find(this.selector)
42
- .filter(':visible')
43
51
  .map(function () {
44
52
  var $el = $(this)
45
53
  var href = $el.data('target') || $el.attr('href')
@@ -48,7 +56,7 @@
48
56
  return ($href
49
57
  && $href.length
50
58
  && $href.is(':visible')
51
- && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
59
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
52
60
  })
53
61
  .sort(function (a, b) { return a[0] - b[0] })
54
62
  .each(function () {
@@ -59,15 +67,19 @@
59
67
 
60
68
  ScrollSpy.prototype.process = function () {
61
69
  var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
62
- var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
70
+ var scrollHeight = this.getScrollHeight()
63
71
  var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
64
72
  var offsets = this.offsets
65
73
  var targets = this.targets
66
74
  var activeTarget = this.activeTarget
67
75
  var i
68
76
 
77
+ if (this.scrollHeight != scrollHeight) {
78
+ this.refresh()
79
+ }
80
+
69
81
  if (scrollTop >= maxScroll) {
70
- return activeTarget != (i = targets.last()[0]) && this.activate(i)
82
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
71
83
  }
72
84
 
73
85
  if (activeTarget && scrollTop <= offsets[0]) {
@@ -78,7 +90,7 @@
78
90
  activeTarget != targets[i]
79
91
  && scrollTop >= offsets[i]
80
92
  && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
81
- && this.activate( targets[i] )
93
+ && this.activate(targets[i])
82
94
  }
83
95
  }
84
96
 
@@ -8,7 +8,7 @@
8
8
  this.element = $(element)
9
9
  }
10
10
 
11
- Tab.VERSION = '3.1.1'
11
+ Tab.VERSION = '3.2.0'
12
12
 
13
13
  Tab.prototype.show = function () {
14
14
  var $this = this.element
@@ -17,7 +17,7 @@
17
17
 
18
18
  if (!selector) {
19
19
  selector = $this.attr('href')
20
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
20
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
21
21
  }
22
22
 
23
23
  if ($this.parent('li').hasClass('active')) return
@@ -72,7 +72,7 @@
72
72
 
73
73
  transition ?
74
74
  $active
75
- .one($.support.transition.end, next)
75
+ .one('bsTransitionEnd', next)
76
76
  .emulateTransitionEnd(150) :
77
77
  next()
78
78
 
@@ -83,7 +83,7 @@
83
83
  // TAB PLUGIN DEFINITION
84
84
  // =====================
85
85
 
86
- function Plugin( option ) {
86
+ function Plugin(option) {
87
87
  return this.each(function () {
88
88
  var $this = $(this)
89
89
  var data = $this.data('bs.tab')
@@ -15,7 +15,7 @@
15
15
  this.init('tooltip', element, options)
16
16
  }
17
17
 
18
- Tooltip.VERSION = '3.1.1'
18
+ Tooltip.VERSION = '3.2.0'
19
19
 
20
20
  Tooltip.DEFAULTS = {
21
21
  animation: true,
@@ -135,8 +135,9 @@
135
135
  if (this.hasContent() && this.enabled) {
136
136
  this.$element.trigger(e)
137
137
 
138
- if (e.isDefaultPrevented()) return
139
- var that = this;
138
+ var inDom = $.contains(document.documentElement, this.$element[0])
139
+ if (e.isDefaultPrevented() || !inDom) return
140
+ var that = this
140
141
 
141
142
  var $tip = this.tip()
142
143
 
@@ -187,15 +188,15 @@
187
188
  var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
188
189
 
189
190
  this.applyPlacement(calculatedOffset, placement)
190
- this.hoverState = null
191
191
 
192
- var complete = function() {
192
+ var complete = function () {
193
193
  that.$element.trigger('shown.bs.' + that.type)
194
+ that.hoverState = null
194
195
  }
195
196
 
196
197
  $.support.transition && this.$tip.hasClass('fade') ?
197
198
  $tip
198
- .one($.support.transition.end, complete)
199
+ .one('bsTransitionEnd', complete)
199
200
  .emulateTransitionEnd(150) :
200
201
  complete()
201
202
  }
@@ -283,7 +284,7 @@
283
284
 
284
285
  $.support.transition && this.$tip.hasClass('fade') ?
285
286
  $tip
286
- .one($.support.transition.end, complete)
287
+ .one('bsTransitionEnd', complete)
287
288
  .emulateTransitionEnd(150) :
288
289
  complete()
289
290
 
@@ -294,7 +295,7 @@
294
295
 
295
296
  Tooltip.prototype.fixTitle = function () {
296
297
  var $e = this.$element
297
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
298
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
298
299
  $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
299
300
  }
300
301
  }
@@ -311,7 +312,7 @@
311
312
  scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
312
313
  width: isBody ? $(window).width() : $element.outerWidth(),
313
314
  height: isBody ? $(window).height() : $element.outerHeight()
314
- }, isBody ? {top: 0, left: 0} : $element.offset())
315
+ }, isBody ? { top: 0, left: 0 } : $element.offset())
315
316
  }
316
317
 
317
318
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -368,11 +369,11 @@
368
369
  }
369
370
 
370
371
  Tooltip.prototype.tip = function () {
371
- return this.$tip = this.$tip || $(this.options.template)
372
+ return (this.$tip = this.$tip || $(this.options.template))
372
373
  }
373
374
 
374
375
  Tooltip.prototype.arrow = function () {
375
- return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
376
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
376
377
  }
377
378
 
378
379
  Tooltip.prototype.validate = function () {
@@ -25,8 +25,9 @@
25
25
 
26
26
  // http://blog.alexmaccaw.com/css-transitions
27
27
  $.fn.emulateTransitionEnd = function (duration) {
28
- var called = false, $el = this
29
- $(this).one($.support.transition.end, function () { called = true })
28
+ var called = false
29
+ var $el = this
30
+ $(this).one('bsTransitionEnd', function () { called = true })
30
31
  var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
31
32
  setTimeout(callback, duration)
32
33
  return this
@@ -34,6 +35,16 @@
34
35
 
35
36
  $(function () {
36
37
  $.support.transition = transitionEnd()
38
+
39
+ if (!$.support.transition) return
40
+
41
+ $.event.special.bsTransitionEnd = {
42
+ bindType: $.support.transition.end,
43
+ delegateType: $.support.transition.end,
44
+ handle: function (e) {
45
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
46
+ }
47
+ }
37
48
  })
38
49
 
39
50
  }(jQuery);
@@ -22,7 +22,8 @@ table {
22
22
  text-align: left;
23
23
  vertical-align: middle;
24
24
  }
25
- .table th {
25
+ .table th,
26
+ .table tfoot td {
26
27
  background: rgba(236,238,241,1);
27
28
  color: rgba(71,74,84,1);
28
29
  font-size: 14px;
@@ -39,7 +40,8 @@ table {
39
40
  .table thead:first-child tr:first-child td { border-top: 0; }
40
41
  .table tbody + tbody { border-top: 2px solid rgba(217,222,225,1); }
41
42
  .table .table { background: rgba(255,255,255,1); }
42
- .table-condensed th {
43
+ .table-condensed th,
44
+ .table-condensed tfoot td {
43
45
  font-size: 12px;
44
46
  padding: 5px;
45
47
  }
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: 2.0.1
4
+ version: 2.1.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-05-30 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 2.2.2
153
+ rubygems_version: 2.3.0
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Flashgrid Responsive Web Framework