active_frontend 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 576555d691b295ba9265dc4fd32e049c06e04bfa
4
- data.tar.gz: 85d74447ddb42b659379b9815db67d6d40308f45
3
+ metadata.gz: 29b35a8a9004aa928de48a975c29fa7e3e059aa6
4
+ data.tar.gz: ad9af5736fe77d2d1c5ad310a8540821659f5fc9
5
5
  SHA512:
6
- metadata.gz: b1499946410932f21737263b53e0ca01ae328c0fb27a49ea0e6c4cb811a73ac6708be90e6eb0761a5ae2be7696fb40f5c90cabe84ece59346607d3ae36a8fdd8
7
- data.tar.gz: 2f1aa2db4da2028d6da5b8a9c84abb132c4eb5ed35f99493ab9cd73350b6d1991733e3dc71f900c06db1cb17f708ad98f33fc6f4dd6a3f68e5cc1763ad5dcf85
6
+ metadata.gz: 12892902f34a5fca4b1890d026605363521822a54b38f2521872f8f6f4028d429935945535d45a9362511cb2eee825236dd36076d005648d77e2375e5fdb8c87
7
+ data.tar.gz: 2b879180927c23a518f48f02412ff76ef246f0ae92b0004c039fabfaf0526cb22ff6861bdabb9d772021424b19914be2fa73f2d93a4d198e34cd6a11a503c62a
@@ -1,3 +1,3 @@
1
1
  module ActiveFrontend
2
- VERSION = "2.0.10"
2
+ VERSION = "2.0.11"
3
3
  end
@@ -12,14 +12,14 @@
12
12
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
13
13
 
14
14
  this.$element = $(element)
15
- this.affixed = null
16
- this.unpin = null
15
+ this.affixed =
16
+ this.unpin =
17
17
  this.pinnedOffset = null
18
18
 
19
19
  this.checkPosition()
20
20
  }
21
21
 
22
- Affix.VERSION = '3.3.4'
22
+ Affix.VERSION = '3.3.2'
23
23
 
24
24
  Affix.RESET = 'affix affix-top affix-bottom'
25
25
 
@@ -69,7 +69,7 @@
69
69
  var offset = this.options.offset
70
70
  var offsetTop = offset.top
71
71
  var offsetBottom = offset.bottom
72
- var scrollHeight = $(document.body).height()
72
+ var scrollHeight = $('body').height()
73
73
 
74
74
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
75
75
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
@@ -9,7 +9,7 @@
9
9
  $(el).on('click', dismiss, this.close)
10
10
  }
11
11
 
12
- Alert.VERSION = '3.3.4'
12
+ Alert.VERSION = '3.3.2'
13
13
 
14
14
  Alert.TRANSITION_DURATION = 150
15
15
 
@@ -10,7 +10,7 @@
10
10
  this.isLoading = false
11
11
  }
12
12
 
13
- Button.VERSION = '3.3.4'
13
+ Button.VERSION = '3.3.2'
14
14
 
15
15
  Button.DEFAULTS = {
16
16
  loadingText: 'loading...'
@@ -8,10 +8,10 @@
8
8
  this.$element = $(element)
9
9
  this.$indicators = this.$element.find('.carousel-indicators')
10
10
  this.options = options
11
- this.paused = null
12
- this.sliding = null
13
- this.interval = null
14
- this.$active = null
11
+ this.paused =
12
+ this.sliding =
13
+ this.interval =
14
+ this.$active =
15
15
  this.$items = null
16
16
 
17
17
  this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
@@ -21,7 +21,7 @@
21
21
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
22
22
  }
23
23
 
24
- Carousel.VERSION = '3.3.4'
24
+ Carousel.VERSION = '3.3.2'
25
25
 
26
26
  Carousel.TRANSITION_DURATION = 600
27
27
 
@@ -7,8 +7,7 @@
7
7
  var Collapse = function (element, options) {
8
8
  this.$element = $(element)
9
9
  this.options = $.extend({}, Collapse.DEFAULTS, options)
10
- this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
11
- '[data-toggle="collapse"][data-target="#' + element.id + '"]')
10
+ this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
12
11
  this.transitioning = null
13
12
 
14
13
  if (this.options.parent) {
@@ -20,12 +19,13 @@
20
19
  if (this.options.toggle) this.toggle()
21
20
  }
22
21
 
23
- Collapse.VERSION = '3.3.4'
22
+ Collapse.VERSION = '3.3.2'
24
23
 
25
24
  Collapse.TRANSITION_DURATION = 350
26
25
 
27
26
  Collapse.DEFAULTS = {
28
- toggle: true
27
+ toggle: true,
28
+ trigger: '[data-toggle="collapse"]'
29
29
  }
30
30
 
31
31
  Collapse.prototype.dimension = function () {
@@ -163,7 +163,7 @@
163
163
  var data = $this.data('bs.collapse')
164
164
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
165
165
 
166
- if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
166
+ if (!data && options.toggle && option == 'show') options.toggle = false
167
167
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
168
168
  if (typeof option == 'string') data[option]()
169
169
  })
@@ -194,7 +194,7 @@
194
194
 
195
195
  var $target = getTargetFromTrigger($this)
196
196
  var data = $target.data('bs.collapse')
197
- var option = data ? 'toggle' : $this.data()
197
+ var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
198
198
 
199
199
  Plugin.call($target, option)
200
200
  })
@@ -10,7 +10,7 @@
10
10
  $(element).on('click.bs.dropdown', this.toggle)
11
11
  }
12
12
 
13
- Dropdown.VERSION = '3.3.4'
13
+ Dropdown.VERSION = '3.3.2'
14
14
 
15
15
  Dropdown.prototype.toggle = function (e) {
16
16
  var $this = $(this)
@@ -63,7 +63,7 @@
63
63
  return $this.trigger('click')
64
64
  }
65
65
 
66
- var desc = ' li:not(.disabled):visible a'
66
+ var desc = ' li:not(.divider):visible a'
67
67
  var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
68
68
 
69
69
  if (!$items.length) return
@@ -10,7 +10,7 @@
10
10
 
11
11
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
12
12
 
13
- Popover.VERSION = '3.3.4'
13
+ Popover.VERSION = '3.3.2'
14
14
 
15
15
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
16
16
  placement: 'right',
@@ -66,6 +66,11 @@
66
66
  return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
67
67
  }
68
68
 
69
+ Popover.prototype.tip = function () {
70
+ if (!this.$tip) this.$tip = $(this.options.template)
71
+ return this.$tip
72
+ }
73
+
69
74
 
70
75
  // POPOVER PLUGIN DEFINITION
71
76
  // =========================
@@ -76,7 +81,7 @@
76
81
  var data = $this.data('bs.popover')
77
82
  var options = typeof option == 'object' && option
78
83
 
79
- if (!data && /destroy|hide/.test(option)) return
84
+ if (!data && option == 'destroy') return
80
85
  if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
81
86
  if (typeof option == 'string') data[option]()
82
87
  })
@@ -5,8 +5,10 @@
5
5
  // ==========================
6
6
 
7
7
  function ScrollSpy(element, options) {
8
- this.$body = $(document.body)
9
- this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
8
+ var process = $.proxy(this.process, this)
9
+
10
+ this.$body = $('body')
11
+ this.$scrollElement = $(element).is('body') ? $(window) : $(element)
10
12
  this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
11
13
  this.selector = (this.options.target || '') + ' .nav li > a'
12
14
  this.offsets = []
@@ -14,12 +16,12 @@
14
16
  this.activeTarget = null
15
17
  this.scrollHeight = 0
16
18
 
17
- this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
19
+ this.$scrollElement.on('scroll.bs.scrollspy', process)
18
20
  this.refresh()
19
21
  this.process()
20
22
  }
21
23
 
22
- ScrollSpy.VERSION = '3.3.4'
24
+ ScrollSpy.VERSION = '3.3.2'
23
25
 
24
26
  ScrollSpy.DEFAULTS = {
25
27
  offset: 10
@@ -30,19 +32,20 @@
30
32
  }
31
33
 
32
34
  ScrollSpy.prototype.refresh = function () {
33
- var that = this
34
- var offsetMethod = 'offset'
35
- var offsetBase = 0
36
-
37
- this.offsets = []
38
- this.targets = []
39
- this.scrollHeight = this.getScrollHeight()
35
+ var offsetMethod = 'offset'
36
+ var offsetBase = 0
40
37
 
41
38
  if (!$.isWindow(this.$scrollElement[0])) {
42
39
  offsetMethod = 'position'
43
40
  offsetBase = this.$scrollElement.scrollTop()
44
41
  }
45
42
 
43
+ this.offsets = []
44
+ this.targets = []
45
+ this.scrollHeight = this.getScrollHeight()
46
+
47
+ var self = this
48
+
46
49
  this.$body
47
50
  .find(this.selector)
48
51
  .map(function () {
@@ -57,8 +60,8 @@
57
60
  })
58
61
  .sort(function (a, b) { return a[0] - b[0] })
59
62
  .each(function () {
60
- that.offsets.push(this[0])
61
- that.targets.push(this[1])
63
+ self.offsets.push(this[0])
64
+ self.targets.push(this[1])
62
65
  })
63
66
  }
64
67
 
@@ -87,7 +90,7 @@
87
90
  for (i = offsets.length; i--;) {
88
91
  activeTarget != targets[i]
89
92
  && scrollTop >= offsets[i]
90
- && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
93
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
91
94
  && this.activate(targets[i])
92
95
  }
93
96
  }
@@ -98,8 +101,8 @@
98
101
  this.clear()
99
102
 
100
103
  var selector = this.selector +
101
- '[data-target="' + target + '"],' +
102
- this.selector + '[href="' + target + '"]'
104
+ '[data-target="' + target + '"],' +
105
+ this.selector + '[href="' + target + '"]'
103
106
 
104
107
  var active = $(selector)
105
108
  .parents('li')
@@ -8,7 +8,7 @@
8
8
  this.element = $(element)
9
9
  }
10
10
 
11
- Tab.VERSION = '3.3.4'
11
+ Tab.VERSION = '3.3.2'
12
12
 
13
13
  Tab.TRANSITION_DURATION = 150
14
14
 
@@ -79,7 +79,7 @@
79
79
  element.removeClass('fade')
80
80
  }
81
81
 
82
- if (element.parent('.dropdown-menu').length) {
82
+ if (element.parent('.dropdown-menu')) {
83
83
  element
84
84
  .closest('li.dropdown')
85
85
  .addClass('active')
@@ -5,17 +5,17 @@
5
5
  // ===============================
6
6
 
7
7
  var Tooltip = function (element, options) {
8
- this.type = null
9
- this.options = null
10
- this.enabled = null
11
- this.timeout = null
12
- this.hoverState = null
8
+ this.type =
9
+ this.options =
10
+ this.enabled =
11
+ this.timeout =
12
+ this.hoverState =
13
13
  this.$element = null
14
14
 
15
15
  this.init('tooltip', element, options)
16
16
  }
17
17
 
18
- Tooltip.VERSION = '3.3.4'
18
+ Tooltip.VERSION = '3.3.2'
19
19
 
20
20
  Tooltip.TRANSITION_DURATION = 150
21
21
 
@@ -42,10 +42,6 @@
42
42
  this.options = this.getOptions(options)
43
43
  this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
44
44
 
45
- if (this.$element[0] instanceof document.constructor && !this.options.selector) {
46
- throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
47
- }
48
-
49
45
  var triggers = this.options.trigger.split(' ')
50
46
 
51
47
  for (var i = triggers.length; i--;) {
@@ -266,10 +262,10 @@
266
262
  this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
267
263
  }
268
264
 
269
- Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
265
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
270
266
  this.arrow()
271
- .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
272
- .css(isVertical ? 'top' : 'left', '')
267
+ .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
268
+ .css(isHorizontal ? 'top' : 'left', '')
273
269
  }
274
270
 
275
271
  Tooltip.prototype.setContent = function () {
@@ -282,7 +278,7 @@
282
278
 
283
279
  Tooltip.prototype.hide = function (callback) {
284
280
  var that = this
285
- var $tip = $(this.$tip)
281
+ var $tip = this.tip()
286
282
  var e = $.Event('hide.bs.' + this.type)
287
283
 
288
284
  function complete() {
@@ -299,7 +295,7 @@
299
295
 
300
296
  $tip.removeClass('in')
301
297
 
302
- $.support.transition && $tip.hasClass('fade') ?
298
+ $.support.transition && this.$tip.hasClass('fade') ?
303
299
  $tip
304
300
  .one('bsTransitionEnd', complete)
305
301
  .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
@@ -443,7 +439,7 @@
443
439
  var data = $this.data('bs.tooltip')
444
440
  var options = typeof option == 'object' && option
445
441
 
446
- if (!data && /destroy|hide/.test(option)) return
442
+ if (!data && option == 'destroy') return
447
443
  if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
448
444
  if (typeof option == 'string') data[option]()
449
445
  })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.10
4
+ version: 2.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez