flashgrid 3.2.1 → 3.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 +4 -4
- data/README.md +2 -2
- data/lib/flashgrid/version.rb +1 -1
- data/vendor/assets/javascripts/affix.js +1 -1
- data/vendor/assets/javascripts/alert.js +1 -1
- data/vendor/assets/javascripts/animation.js +37 -77
- data/vendor/assets/javascripts/button.js +6 -4
- data/vendor/assets/javascripts/carousel.js +8 -3
- data/vendor/assets/javascripts/collapse.js +50 -17
- data/vendor/assets/javascripts/dropdown.js +5 -3
- data/vendor/assets/javascripts/modal.js +20 -21
- data/vendor/assets/javascripts/popover.js +11 -5
- data/vendor/assets/javascripts/scrollspy.js +11 -6
- data/vendor/assets/javascripts/{switch.js → swoggle.js} +55 -55
- data/vendor/assets/javascripts/tab.js +35 -12
- data/vendor/assets/javascripts/tooltip.js +21 -24
- data/vendor/assets/stylesheets/animation.css.scss +6 -4
- data/vendor/assets/stylesheets/{switch.css.scss → swoggle.css.scss} +23 -23
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30927f439da1c0f4a5972e27e9260fc9d2a76f6c
|
4
|
+
data.tar.gz: f7c6d592f41e1c436fa89c2345708a0aa1761e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb98838ed6930a4272e823ebaa71dede8ebf9640ab82b333373378bc096ae3bf0c921eaf7a96305e2eebb88860cf50d9f05432ddc5c3bdff07e399e738d5065
|
7
|
+
data.tar.gz: 19e4e88dd1f1286b59130fdb59955d94097a894e676ed12dece5656ca9252bb7c6112c1b3cfca49e3700e3dd6caf989d4f0bb683641ba934c19e6c1c069dede8
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ Add the CSS files you want to include:
|
|
55
55
|
*= require progress.css
|
56
56
|
*= require reset.css (place before any files)
|
57
57
|
*= require spinner.css
|
58
|
-
*= require
|
58
|
+
*= require swoggle.css
|
59
59
|
*= require table.css
|
60
60
|
*= require timepicker.css
|
61
61
|
*= require tooltip.css
|
@@ -81,7 +81,7 @@ Add the JS files you want to include:
|
|
81
81
|
//= require modal.js
|
82
82
|
//= require popover.js (place after tooltip)
|
83
83
|
//= require scrollspy.js
|
84
|
-
//= require
|
84
|
+
//= require swoggle.js
|
85
85
|
//= require tab.js
|
86
86
|
//= require tablespy.js
|
87
87
|
//= require time_picker.js
|
data/lib/flashgrid/version.rb
CHANGED
@@ -1,82 +1,42 @@
|
|
1
1
|
(function ($, window, document, undefined) {
|
2
|
-
|
3
|
-
// Function-level strict mode syntax
|
4
2
|
'use strict';
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
// If the element is hidden
|
34
|
-
if ($this.is(":" + hidden)) {
|
35
|
-
|
36
|
-
// Show it
|
37
|
-
$this.show();
|
38
|
-
|
39
|
-
}
|
40
|
-
|
41
|
-
// Event triggered when the animation has finished
|
42
|
-
$this.bind( transitionEnd, function () {
|
43
|
-
|
44
|
-
// Remove the classes so they can be added again later
|
45
|
-
$this.removeClass(animated + " " + effect);
|
46
|
-
|
47
|
-
// Add a callback event
|
48
|
-
if (typeof callback === "function") {
|
49
|
-
|
50
|
-
// Execute the callback
|
51
|
-
callback.call(this);
|
52
|
-
|
53
|
-
// Unbind the event handlers
|
54
|
-
$this.unbind( transitionEnd );
|
55
|
-
|
56
|
-
}
|
57
|
-
|
58
|
-
});
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
// Check if delay exists or if it"s a callback
|
63
|
-
if (!delay || typeof delay === "function") {
|
64
|
-
|
65
|
-
// If it"s a callback, move it to callback so we can call it later
|
66
|
-
callback = delay;
|
67
|
-
|
68
|
-
// Run the animation (without delay)
|
69
|
-
run();
|
70
|
-
|
71
|
-
} else {
|
72
|
-
|
73
|
-
// Start a counter so we can delay the animation if required
|
74
|
-
setTimeout( run, delay );
|
75
|
-
|
76
|
-
}
|
77
|
-
|
4
|
+
$.fn.animateCSS = function (effect, delay, callback) {
|
5
|
+
return this.each(function () {
|
6
|
+
var $this = $(this),
|
7
|
+
transitionEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend",
|
8
|
+
animated = "animated",
|
9
|
+
visibility = "visibility",
|
10
|
+
visible = "visible",
|
11
|
+
hidden = "hidden";
|
12
|
+
|
13
|
+
function run() {
|
14
|
+
$this.addClass( animated + " " + effect);
|
15
|
+
|
16
|
+
if ($this.css( visibility ) === hidden) {
|
17
|
+
$this.css( visibility, visible);
|
18
|
+
};
|
19
|
+
|
20
|
+
if ($this.is(":" + hidden)) {
|
21
|
+
$this.show();
|
22
|
+
};
|
23
|
+
|
24
|
+
$this.bind( transitionEnd, function () {
|
25
|
+
$this.removeClass(animated + " " + effect);
|
26
|
+
|
27
|
+
if (typeof callback === "function") {
|
28
|
+
callback.call(this);
|
29
|
+
$this.unbind( transitionEnd );
|
30
|
+
};
|
78
31
|
});
|
79
|
-
|
80
|
-
|
81
|
-
|
32
|
+
};
|
33
|
+
|
34
|
+
if (!delay || typeof delay === "function") {
|
35
|
+
callback = delay;
|
36
|
+
run();
|
37
|
+
} else {
|
38
|
+
setTimeout( run, delay );
|
39
|
+
};
|
40
|
+
});
|
41
|
+
};
|
82
42
|
})(jQuery, window, document);
|
@@ -10,7 +10,7 @@
|
|
10
10
|
this.isLoading = false
|
11
11
|
}
|
12
12
|
|
13
|
-
Button.VERSION = '3.
|
13
|
+
Button.VERSION = '3.3.0'
|
14
14
|
|
15
15
|
Button.DEFAULTS = {
|
16
16
|
loadingText: 'loading...'
|
@@ -26,10 +26,10 @@
|
|
26
26
|
|
27
27
|
if (data.resetText == null) $el.data('resetText', $el[val]())
|
28
28
|
|
29
|
-
$el[val](data[state] == null ? this.options[state] : data[state])
|
30
|
-
|
31
29
|
// push to event loop to allow forms to submit
|
32
30
|
setTimeout($.proxy(function () {
|
31
|
+
$el[val](data[state] == null ? this.options[state] : data[state])
|
32
|
+
|
33
33
|
if (state == 'loadingText') {
|
34
34
|
this.isLoading = true
|
35
35
|
$el.addClass(d).attr(d, d)
|
@@ -51,6 +51,8 @@
|
|
51
51
|
else $parent.find('.active').removeClass('active')
|
52
52
|
}
|
53
53
|
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
54
|
+
} else {
|
55
|
+
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
|
54
56
|
}
|
55
57
|
|
56
58
|
if (changed) this.$element.toggleClass('active')
|
@@ -99,7 +101,7 @@
|
|
99
101
|
e.preventDefault()
|
100
102
|
})
|
101
103
|
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
102
|
-
$(e.target).closest('.btn').toggleClass('focus', e.type
|
104
|
+
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
|
103
105
|
})
|
104
106
|
|
105
107
|
}(jQuery);
|
@@ -21,7 +21,7 @@
|
|
21
21
|
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
22
22
|
}
|
23
23
|
|
24
|
-
Carousel.VERSION = '3.
|
24
|
+
Carousel.VERSION = '3.3.0'
|
25
25
|
|
26
26
|
Carousel.TRANSITION_DURATION = 600
|
27
27
|
|
@@ -33,6 +33,7 @@
|
|
33
33
|
}
|
34
34
|
|
35
35
|
Carousel.prototype.keydown = function (e) {
|
36
|
+
if (/input|textarea/i.test(e.target.tagName)) return
|
36
37
|
switch (e.which) {
|
37
38
|
case 37: this.prev(); break
|
38
39
|
case 39: this.next(); break
|
@@ -198,7 +199,7 @@
|
|
198
199
|
// CAROUSEL DATA-API
|
199
200
|
// =================
|
200
201
|
|
201
|
-
|
202
|
+
var clickHandler = function (e) {
|
202
203
|
var href
|
203
204
|
var $this = $(this)
|
204
205
|
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
@@ -214,7 +215,11 @@
|
|
214
215
|
}
|
215
216
|
|
216
217
|
e.preventDefault()
|
217
|
-
}
|
218
|
+
}
|
219
|
+
|
220
|
+
$(document)
|
221
|
+
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
|
222
|
+
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
|
218
223
|
|
219
224
|
$(window).on('load', function () {
|
220
225
|
$('[data-ride="carousel"]').each(function () {
|
@@ -7,18 +7,25 @@
|
|
7
7
|
var Collapse = function (element, options) {
|
8
8
|
this.$element = $(element)
|
9
9
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
10
|
+
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
|
10
11
|
this.transitioning = null
|
11
12
|
|
12
|
-
if (this.options.parent)
|
13
|
+
if (this.options.parent) {
|
14
|
+
this.$parent = this.getParent()
|
15
|
+
} else {
|
16
|
+
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
|
17
|
+
}
|
18
|
+
|
13
19
|
if (this.options.toggle) this.toggle()
|
14
20
|
}
|
15
21
|
|
16
|
-
Collapse.VERSION = '3.
|
22
|
+
Collapse.VERSION = '3.3.0'
|
17
23
|
|
18
24
|
Collapse.TRANSITION_DURATION = 350
|
19
25
|
|
20
26
|
Collapse.DEFAULTS = {
|
21
|
-
toggle: true
|
27
|
+
toggle: true,
|
28
|
+
trigger: '[data-toggle="collapse"]'
|
22
29
|
}
|
23
30
|
|
24
31
|
Collapse.prototype.dimension = function () {
|
@@ -53,6 +60,10 @@
|
|
53
60
|
.addClass('collapsing')[dimension](0)
|
54
61
|
.attr('aria-expanded', true)
|
55
62
|
|
63
|
+
this.$trigger
|
64
|
+
.removeClass('collapsed')
|
65
|
+
.attr('aria-expanded', true)
|
66
|
+
|
56
67
|
this.transitioning = 1
|
57
68
|
|
58
69
|
var complete = function () {
|
@@ -89,6 +100,10 @@
|
|
89
100
|
.removeClass('collapse in')
|
90
101
|
.attr('aria-expanded', false)
|
91
102
|
|
103
|
+
this.$trigger
|
104
|
+
.addClass('collapsed')
|
105
|
+
.attr('aria-expanded', false)
|
106
|
+
|
92
107
|
this.transitioning = 1
|
93
108
|
|
94
109
|
var complete = function () {
|
@@ -111,6 +126,33 @@
|
|
111
126
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
112
127
|
}
|
113
128
|
|
129
|
+
Collapse.prototype.getParent = function () {
|
130
|
+
return $(this.options.parent)
|
131
|
+
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
132
|
+
.each($.proxy(function (i, element) {
|
133
|
+
var $element = $(element)
|
134
|
+
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
|
135
|
+
}, this))
|
136
|
+
.end()
|
137
|
+
}
|
138
|
+
|
139
|
+
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
|
140
|
+
var isOpen = $element.hasClass('in')
|
141
|
+
|
142
|
+
$element.attr('aria-expanded', isOpen)
|
143
|
+
$trigger
|
144
|
+
.toggleClass('collapsed', !isOpen)
|
145
|
+
.attr('aria-expanded', isOpen)
|
146
|
+
}
|
147
|
+
|
148
|
+
function getTargetFromTrigger($trigger) {
|
149
|
+
var href
|
150
|
+
var target = $trigger.attr('data-target')
|
151
|
+
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
152
|
+
|
153
|
+
return $(target)
|
154
|
+
}
|
155
|
+
|
114
156
|
|
115
157
|
// COLLAPSE PLUGIN DEFINITION
|
116
158
|
// ==========================
|
@@ -146,22 +188,13 @@
|
|
146
188
|
// =================
|
147
189
|
|
148
190
|
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
149
|
-
var href
|
150
191
|
var $this = $(this)
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
var $target = $
|
192
|
+
|
193
|
+
if (!$this.attr('data-target')) e.preventDefault()
|
194
|
+
|
195
|
+
var $target = getTargetFromTrigger($this)
|
155
196
|
var data = $target.data('bs.collapse')
|
156
|
-
var option = data ? 'toggle' : $this.data()
|
157
|
-
var parent = $this.attr('data-parent')
|
158
|
-
var $parent = parent && $(parent)
|
159
|
-
|
160
|
-
if (!data || !data.transitioning) {
|
161
|
-
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed').attr('aria-expanded', false)
|
162
|
-
var isCollapsed = $target.hasClass('in')
|
163
|
-
$this.toggleClass('collapsed', isCollapsed).attr('aria-expanded', !isCollapsed)
|
164
|
-
}
|
197
|
+
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
|
165
198
|
|
166
199
|
Plugin.call($target, option)
|
167
200
|
})
|
@@ -10,7 +10,7 @@
|
|
10
10
|
$(element).on('click.bs.dropdown', this.toggle)
|
11
11
|
}
|
12
12
|
|
13
|
-
Dropdown.VERSION = '3.
|
13
|
+
Dropdown.VERSION = '3.3.0'
|
14
14
|
|
15
15
|
Dropdown.prototype.toggle = function (e) {
|
16
16
|
var $this = $(this)
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
if (!$items.length) return
|
70
70
|
|
71
|
-
var index = $items.index(
|
71
|
+
var index = $items.index(e.target)
|
72
72
|
|
73
73
|
if (e.which == 38 && index > 0) index-- // up
|
74
74
|
if (e.which == 40 && index < $items.length - 1) index++ // down
|
@@ -145,6 +145,8 @@
|
|
145
145
|
.on('click.bs.dropdown.data-api', clearMenus)
|
146
146
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
147
147
|
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
148
|
-
.on('keydown.bs.dropdown.data-api', toggle
|
148
|
+
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
149
|
+
.on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
|
150
|
+
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
|
149
151
|
|
150
152
|
}(jQuery);
|
@@ -21,10 +21,7 @@
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
Modal.VERSION = '3.
|
25
|
-
|
26
|
-
Modal.TRANSITION_DURATION = 300
|
27
|
-
Modal.BACKDROP_TRANSITION_DURATION = 150
|
24
|
+
Modal.VERSION = '3.3.0'
|
28
25
|
|
29
26
|
Modal.DEFAULTS = {
|
30
27
|
backdrop: true,
|
@@ -82,7 +79,7 @@
|
|
82
79
|
.one('bsTransitionEnd', function () {
|
83
80
|
that.$element.trigger('focus').trigger(e)
|
84
81
|
})
|
85
|
-
.emulateTransitionEnd(
|
82
|
+
.emulateTransitionEnd(300) :
|
86
83
|
that.$element.trigger('focus').trigger(e)
|
87
84
|
})
|
88
85
|
}
|
@@ -98,6 +95,9 @@
|
|
98
95
|
|
99
96
|
this.isShown = false
|
100
97
|
|
98
|
+
this.$body.removeClass('modal-open')
|
99
|
+
|
100
|
+
this.resetScrollbar()
|
101
101
|
this.escape()
|
102
102
|
|
103
103
|
$(document).off('focusin.bs.modal')
|
@@ -110,7 +110,7 @@
|
|
110
110
|
$.support.transition && this.$element.hasClass('fade') ?
|
111
111
|
this.$element
|
112
112
|
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
113
|
-
.emulateTransitionEnd(
|
113
|
+
.emulateTransitionEnd(300) :
|
114
114
|
this.hideModal()
|
115
115
|
}
|
116
116
|
|
@@ -126,11 +126,11 @@
|
|
126
126
|
|
127
127
|
Modal.prototype.escape = function () {
|
128
128
|
if (this.isShown && this.options.keyboard) {
|
129
|
-
this.$element.on('
|
129
|
+
this.$element.on('keyup.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('
|
133
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
134
134
|
}
|
135
135
|
}
|
136
136
|
|
@@ -138,8 +138,6 @@
|
|
138
138
|
var that = this
|
139
139
|
this.$element.hide()
|
140
140
|
this.backdrop(function () {
|
141
|
-
that.$body.removeClass('modal-open')
|
142
|
-
that.resetScrollbar()
|
143
141
|
that.$element.trigger('hidden.bs.modal')
|
144
142
|
})
|
145
143
|
}
|
@@ -157,13 +155,14 @@
|
|
157
155
|
var doAnimate = $.support.transition && animate
|
158
156
|
|
159
157
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
160
|
-
.
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
158
|
+
.appendTo(this.$body)
|
159
|
+
|
160
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
161
|
+
if (e.target !== e.currentTarget) return
|
162
|
+
this.options.backdrop == 'static'
|
163
|
+
? this.$element[0].focus.call(this.$element[0])
|
164
|
+
: this.hide.call(this)
|
165
|
+
}, this))
|
167
166
|
|
168
167
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
169
168
|
|
@@ -174,7 +173,7 @@
|
|
174
173
|
doAnimate ?
|
175
174
|
this.$backdrop
|
176
175
|
.one('bsTransitionEnd', callback)
|
177
|
-
.emulateTransitionEnd(
|
176
|
+
.emulateTransitionEnd(150) :
|
178
177
|
callback()
|
179
178
|
|
180
179
|
} else if (!this.isShown && this.$backdrop) {
|
@@ -187,7 +186,7 @@
|
|
187
186
|
$.support.transition && this.$element.hasClass('fade') ?
|
188
187
|
this.$backdrop
|
189
188
|
.one('bsTransitionEnd', callbackRemove)
|
190
|
-
.emulateTransitionEnd(
|
189
|
+
.emulateTransitionEnd(150) :
|
191
190
|
callbackRemove()
|
192
191
|
|
193
192
|
} else if (callback) {
|
@@ -196,7 +195,8 @@
|
|
196
195
|
}
|
197
196
|
|
198
197
|
Modal.prototype.checkScrollbar = function () {
|
199
|
-
|
198
|
+
if (document.body.clientWidth >= window.innerWidth) return
|
199
|
+
this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
|
200
200
|
}
|
201
201
|
|
202
202
|
Modal.prototype.setScrollbar = function () {
|
@@ -209,7 +209,6 @@
|
|
209
209
|
}
|
210
210
|
|
211
211
|
Modal.prototype.measureScrollbar = function () { // thx walsh
|
212
|
-
if (document.body.clientWidth >= window.innerWidth) return 0
|
213
212
|
var scrollDiv = document.createElement('div')
|
214
213
|
scrollDiv.className = 'modal-scrollbar-measure'
|
215
214
|
this.$body.append(scrollDiv)
|