flashgrid 1.0.13 → 1.0.14

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.
@@ -1,4 +1,5 @@
1
- +function ($) { "use strict";
1
+ +function ($) {
2
+ 'use strict';
2
3
 
3
4
  // TAB CLASS DEFINITION
4
5
  // ====================
@@ -33,8 +34,8 @@
33
34
  this.activate($this.parent('li'), $ul)
34
35
  this.activate($target, $target.parent(), function () {
35
36
  $this.trigger({
36
- type: 'shown.bs.tab'
37
- , relatedTarget: previous
37
+ type: 'shown.bs.tab',
38
+ relatedTarget: previous
38
39
  })
39
40
  })
40
41
  }
@@ -1,4 +1,5 @@
1
- +function ($) { "use strict";
1
+ +function ($) {
2
+ 'use strict';
2
3
 
3
4
  // TOOLTIP PUBLIC CLASS DEFINITION
4
5
  // ===============================
@@ -15,15 +16,15 @@
15
16
  }
16
17
 
17
18
  Tooltip.DEFAULTS = {
18
- animation: true
19
- , placement: 'top'
20
- , selector: false
21
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
22
- , trigger: 'hover focus'
23
- , title: ''
24
- , delay: 0
25
- , html: false
26
- , container: false
19
+ animation: true,
20
+ placement: 'top',
21
+ selector: false,
22
+ template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
23
+ trigger: 'hover focus',
24
+ title: '',
25
+ delay: 0,
26
+ html: false,
27
+ container: false
27
28
  }
28
29
 
29
30
  Tooltip.prototype.init = function (type, element, options) {
@@ -40,8 +41,8 @@
40
41
  if (trigger == 'click') {
41
42
  this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
42
43
  } else if (trigger != 'manual') {
43
- var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
44
- var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
44
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
45
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
45
46
 
46
47
  this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
47
48
  this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
@@ -62,8 +63,8 @@
62
63
 
63
64
  if (options.delay && typeof options.delay == 'number') {
64
65
  options.delay = {
65
- show: options.delay
66
- , hide: options.delay
66
+ show: options.delay,
67
+ hide: options.delay
67
68
  }
68
69
  }
69
70
 
@@ -112,12 +113,13 @@
112
113
  }
113
114
 
114
115
  Tooltip.prototype.show = function () {
115
- var e = $.Event('show.bs.'+ this.type)
116
+ var e = $.Event('show.bs.' + this.type)
116
117
 
117
118
  if (this.hasContent() && this.enabled) {
118
119
  this.$element.trigger(e)
119
120
 
120
121
  if (e.isDefaultPrevented()) return
122
+ var that = this;
121
123
 
122
124
  var $tip = this.tip()
123
125
 
@@ -167,11 +169,21 @@
167
169
  var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
168
170
 
169
171
  this.applyPlacement(calculatedOffset, placement)
170
- this.$element.trigger('shown.bs.' + this.type)
172
+ this.hoverState = null
173
+
174
+ var complete = function() {
175
+ that.$element.trigger('shown.bs.' + that.type)
176
+ }
177
+
178
+ $.support.transition && this.$tip.hasClass('fade') ?
179
+ $tip
180
+ .one($.support.transition.end, complete)
181
+ .emulateTransitionEnd(150) :
182
+ complete()
171
183
  }
172
184
  }
173
185
 
174
- Tooltip.prototype.applyPlacement = function(offset, placement) {
186
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
175
187
  var replace
176
188
  var $tip = this.tip()
177
189
  var width = $tip[0].offsetWidth
@@ -188,9 +200,18 @@
188
200
  offset.top = offset.top + marginTop
189
201
  offset.left = offset.left + marginLeft
190
202
 
191
- $tip
192
- .offset(offset)
193
- .addClass('in')
203
+ // $.fn.offset doesn't round pixel values
204
+ // so we use setOffset directly with our own function B-0
205
+ $.offset.setOffset($tip[0], $.extend({
206
+ using: function (props) {
207
+ $tip.css({
208
+ top: Math.round(props.top),
209
+ left: Math.round(props.left)
210
+ })
211
+ }
212
+ }, offset), 0)
213
+
214
+ $tip.addClass('in')
194
215
 
195
216
  // check to see if placing tip in new offset caused the tip to resize itself
196
217
  var actualWidth = $tip[0].offsetWidth
@@ -222,8 +243,8 @@
222
243
  if (replace) $tip.offset(offset)
223
244
  }
224
245
 
225
- Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
226
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
246
+ Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
247
+ this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
227
248
  }
228
249
 
229
250
  Tooltip.prototype.setContent = function () {
@@ -241,6 +262,7 @@
241
262
 
242
263
  function complete() {
243
264
  if (that.hoverState != 'in') $tip.detach()
265
+ that.$element.trigger('hidden.bs.' + that.type)
244
266
  }
245
267
 
246
268
  this.$element.trigger(e)
@@ -255,7 +277,7 @@
255
277
  .emulateTransitionEnd(150) :
256
278
  complete()
257
279
 
258
- this.$element.trigger('hidden.bs.' + this.type)
280
+ this.hoverState = null
259
281
 
260
282
  return this
261
283
  }
@@ -274,8 +296,8 @@
274
296
  Tooltip.prototype.getPosition = function () {
275
297
  var el = this.$element[0]
276
298
  return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
277
- width: el.offsetWidth
278
- , height: el.offsetHeight
299
+ width: el.offsetWidth,
300
+ height: el.offsetHeight
279
301
  }, this.$element.offset())
280
302
  }
281
303
 
@@ -331,6 +353,7 @@
331
353
  }
332
354
 
333
355
  Tooltip.prototype.destroy = function () {
356
+ clearTimeout(this.timeout)
334
357
  this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
335
358
  }
336
359
 
@@ -346,6 +369,7 @@
346
369
  var data = $this.data('bs.tooltip')
347
370
  var options = typeof option == 'object' && option
348
371
 
372
+ if (!data && option == 'destroy') return
349
373
  if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
350
374
  if (typeof option == 'string') data[option]()
351
375
  })
@@ -1,4 +1,5 @@
1
- +function ($) { "use strict";
1
+ +function ($) {
2
+ 'use strict';
2
3
 
3
4
  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
4
5
  // ============================================================
@@ -7,10 +8,10 @@
7
8
  var el = document.createElement('bootstrap')
8
9
 
9
10
  var transEndEventNames = {
10
- 'WebkitTransition' : 'webkitTransitionEnd'
11
- , 'MozTransition' : 'transitionend'
12
- , 'OTransition' : 'oTransitionEnd otransitionend'
13
- , 'transition' : 'transitionend'
11
+ 'WebkitTransition' : 'webkitTransitionEnd',
12
+ 'MozTransition' : 'transitionend',
13
+ 'OTransition' : 'oTransitionEnd otransitionend',
14
+ 'transition' : 'transitionend'
14
15
  }
15
16
 
16
17
  for (var name in transEndEventNames) {
@@ -18,6 +19,8 @@
18
19
  return { end: transEndEventNames[name] }
19
20
  }
20
21
  }
22
+
23
+ return false // explicit for ie8 ( ._.)
21
24
  }
22
25
 
23
26
  // http://blog.alexmaccaw.com/css-transitions
@@ -4,18 +4,25 @@
4
4
 
5
5
  /* #Switch
6
6
  ================================================== */
7
- .switch input[type=radio],
8
- .switch input[type=checkbox] { display: none; }
7
+ .switch input[type='radio'],
8
+ .switch input[type='checkbox'] {
9
+ left: 0;
10
+ opacity: 0;
11
+ filter: alpha(opacity=0);
12
+ position: absolute !important;
13
+ top: 0;
14
+ z-index: -1;
15
+ }
9
16
  .switch {
10
- background: rgba(58,144,216,1);
17
+ background: rgba(236,238,241,1);
11
18
  border-radius: 500px;
12
- color: rgba(255,255,255,1);
19
+ color: rgba(43,50,53,1);
13
20
  cursor: pointer;
14
21
  display: inline-block;
15
- font-size: 11px;
22
+ font-size: 12px;
16
23
  -webkit-font-smoothing: antialiased;
17
24
  font-weight: bold;
18
- line-height: 11px;
25
+ line-height: 12px;
19
26
  margin-top: -2px;
20
27
  min-width: 64px;
21
28
  overflow: hidden;
@@ -24,6 +31,8 @@
24
31
  text-align: center;
25
32
  text-rendering: geometricPrecision;
26
33
  text-transform: uppercase;
34
+ -webkit-transition: all 0.5s ease-in-out;
35
+ transition: all 0.5s ease-in-out;
27
36
  -webkit-user-select: none;
28
37
  -moz-user-select: none;
29
38
  -ms-user-select: none;
@@ -62,12 +71,28 @@
62
71
  .switch > div {
63
72
  display: inline-block;
64
73
  position: relative;
74
+ -webkit-transform: translate3d(0,0,0);
75
+ transform: translate3d(0,0,0);
65
76
  top: 0;
66
77
  width: 150%;
67
78
  }
68
- .switch > div.switch-off { left: -50%; }
69
- .switch > div.switch-on { left: 0%; }
70
- .switch > div.switch-animate {
71
- -webkit-transition: left 0.5s;
72
- transition: left 0.5s;
79
+ .switch.switch-on > div { margin-left: 0; }
80
+ .switch.switch-off > div { margin-left: -50%; }
81
+ .switch.switch-on.switch-black,
82
+ .switch.switch-on.switch-blue,
83
+ .switch.switch-on.switch-green,
84
+ .switch.switch-on.switch-red { color: rgba(255,255,255,1); }
85
+ .switch.switch-on.switch-black { background: rgba(71,74,84,1); }
86
+ .switch.switch-on.switch-blue { background: rgba(58,144,216,1); }
87
+ .switch.switch-on.switch-green { background: rgba(122,179,23,1); }
88
+ .switch.switch-on.switch-red { background: rgba(254,79,50,1); }
89
+ .switch.switch-animate > div {
90
+ -webkit-transition: margin-left 0.5s;
91
+ transition: margin-left 0.5s;
92
+ }
93
+ .switch.switch-disabled,
94
+ .switch.switch-readonly {
95
+ cursor: default !important;
96
+ opacity: 0.5;
97
+ filter: alpha(opacity=50);
73
98
  }
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: 1.0.13
4
+ version: 1.0.14
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-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler