flashgrid 2.1.2 → 2.2.0

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: 39c16aaf92cfa812fd8ba92dcd8b4092353d089f
4
- data.tar.gz: 04f476567e986b2a09dacaf6d4e196185f673275
3
+ metadata.gz: 4f020b15cb62610660cd889ed7d332b4b246fc94
4
+ data.tar.gz: 494aaf1f28142d0534044d217d9731586743af71
5
5
  SHA512:
6
- metadata.gz: 8f37eb5411b4bea5a455639345447608829c5dee738d563f5bbc52717122aeb47ca8ffda674747586d3a5c694553f8f8f874b8fbe008e8e81295cb20704ecbbc
7
- data.tar.gz: 1e3bc2414717709fcd58a6fe044d3a3a4c05bd55355da713dac6c20501eb418ce8dc09c5c3b9ef25f1574de411f8f52b7bbdd9aad7da513fa67afdb667dd349b
6
+ metadata.gz: 1281ea481aacd8425721f69ee0650da7b4653566a37ad542ae0990f63672690db64b3904713604c0d6ab80b5e7527d0d57a0bed683e159698b8d6de0c07ccd8f
7
+ data.tar.gz: 0bdc9a57d1735079889c122bc47a733721316aa37b83356e5462584effeb6e911168688d84e9c4ad7002dd747a40bce410a8ce6f06eb9e3787af68c4ebc7a8b7
@@ -1,3 +1,3 @@
1
1
  module Flashgrid
2
- VERSION = "2.1.2"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -88,14 +88,30 @@
88
88
  }
89
89
 
90
90
 
91
+ // FOCUS SHIM (FOR BUTTON GROUPS)
92
+ // ==============================
93
+
94
+ function getBtnTarget(target) {
95
+ var $target = $(target)
96
+ return $target.hasClass('btn') ? $target : $target.parent('.btn')
97
+ }
98
+
99
+
91
100
  // BUTTON DATA-API
92
101
  // ===============
93
102
 
94
- $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
95
- var $btn = $(e.target)
96
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
97
- Plugin.call($btn, 'toggle')
98
- e.preventDefault()
99
- })
103
+ $(document)
104
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
105
+ var $btn = $(e.target)
106
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
107
+ Plugin.call($btn, 'toggle')
108
+ e.preventDefault()
109
+ })
110
+ .on('focus.bs.button.data-api', '[data-toggle^="button"]', function (e) {
111
+ getBtnTarget(e.target).addClass('focus')
112
+ })
113
+ .on('blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
114
+ getBtnTarget(e.target).removeClass('focus')
115
+ })
100
116
 
101
117
  }(jQuery);
@@ -79,8 +79,7 @@
79
79
 
80
80
  this.$element
81
81
  .addClass('collapsing')
82
- .removeClass('collapse')
83
- .removeClass('in')
82
+ .removeClass('collapse in')
84
83
 
85
84
  this.transitioning = 1
86
85
 
@@ -152,7 +151,7 @@
152
151
 
153
152
  if (!data || !data.transitioning) {
154
153
  if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
155
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
154
+ $this.toggleClass('collapsed', $target.hasClass('in'))
156
155
  }
157
156
 
158
157
  Plugin.call($target, option)
@@ -34,12 +34,13 @@
34
34
 
35
35
  $parent.hover(function (event) {
36
36
  // so a neighbor can't open the dropdown
37
- if(!$parent.hasClass('open') && !$this.is(event.target)) {
37
+ if($parent.hasClass('open') && !$this.is(event.target)) {
38
38
  // stop this event, stop executing any code
39
39
  // in this callback but continue to propagate
40
40
  return true;
41
41
  }
42
42
 
43
+ window.clearTimeout(timeout);
43
44
  openDropdown(event);
44
45
  }, function () {
45
46
  timeout = window.setTimeout(function () {
@@ -48,11 +49,21 @@
48
49
  }, settings.delay);
49
50
  });
50
51
 
52
+ // clear timeout if hovering submenu
53
+ $allDropdowns.find('.dropdown-menu').hover(function(){
54
+ window.clearTimeout(timeout);
55
+ }, function(){
56
+ timeout = window.setTimeout(function () {
57
+ $parent.removeClass('open');
58
+ $this.trigger(hideEvent);
59
+ }, settings.delay);
60
+ });
61
+
51
62
  // this helps with button groups!
52
63
  $this.hover(function (event) {
53
64
  // this helps prevent a double event from firing.
54
65
  // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55
55
- if(!$parent.hasClass('open') && !$parent.is(event.target)) {
66
+ if($parent.hasClass('open') && !$parent.is(event.target)) {
56
67
  // stop this event, stop executing any code
57
68
  // in this callback but continue to propagate
58
69
  return true;
@@ -126,11 +126,11 @@
126
126
 
127
127
  Modal.prototype.escape = function () {
128
128
  if (this.isShown && this.options.keyboard) {
129
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
129
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
130
130
  e.which == 27 && this.hide()
131
131
  }, this))
132
132
  } else if (!this.isShown) {
133
- this.$element.off('keyup.dismiss.bs.modal')
133
+ this.$element.off('keydown.dismiss.bs.modal')
134
134
  }
135
135
  }
136
136
 
@@ -157,7 +157,7 @@
157
157
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
158
158
  .appendTo(this.$body)
159
159
 
160
- this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
160
+ this.$element.on('mousedown.dismiss.bs.modal', $.proxy(function (e) {
161
161
  if (e.target !== e.currentTarget) return
162
162
  this.options.backdrop == 'static'
163
163
  ? this.$element[0].focus.call(this.$element[0])
@@ -46,7 +46,7 @@
46
46
  var $active = container.find('> .active')
47
47
  var transition = callback
48
48
  && $.support.transition
49
- && $active.hasClass('fade')
49
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
50
50
 
51
51
  function next() {
52
52
  $active
@@ -70,7 +70,7 @@
70
70
  callback && callback()
71
71
  }
72
72
 
73
- transition ?
73
+ $active.length && transition ?
74
74
  $active
75
75
  .one('bsTransitionEnd', next)
76
76
  .emulateTransitionEnd(150) :
@@ -306,13 +306,20 @@
306
306
 
307
307
  Tooltip.prototype.getPosition = function ($element) {
308
308
  $element = $element || this.$element
309
+
309
310
  var el = $element[0]
310
311
  var isBody = el.tagName == 'BODY'
311
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
312
- scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
312
+ var isSvg = window.SVGElement && el instanceof window.SVGElement
313
+
314
+ var elRect = el.getBoundingClientRect ? el.getBoundingClientRect() : null
315
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
316
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
317
+ var outerDims = isSvg ? {} : {
313
318
  width: isBody ? $(window).width() : $element.outerWidth(),
314
319
  height: isBody ? $(window).height() : $element.outerHeight()
315
- }, isBody ? { top: 0, left: 0 } : $element.offset())
320
+ }
321
+
322
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
316
323
  }
317
324
 
318
325
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -36,6 +36,7 @@
36
36
  -webkit-transition: all 0.3s linear;
37
37
  transition: all 0.3s linear;
38
38
  vertical-align: middle;
39
+ white-space: nowrap;
39
40
  }
40
41
  .btn:active,
41
42
  .btn.active,
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.1.2
4
+ version: 2.2.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-07-08 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler