twitter-bootswatch-rails 3.0.3.0 → 3.1.0.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/app/assets/javascripts/twitter/bootstrap/affix.js +34 -23
- data/app/assets/javascripts/twitter/bootstrap/alert.js +5 -15
- data/app/assets/javascripts/twitter/bootstrap/button.js +21 -29
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +16 -28
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +7 -16
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +19 -26
- data/app/assets/javascripts/twitter/bootstrap/modal.js +25 -28
- data/app/assets/javascripts/twitter/bootstrap/popover.js +14 -21
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +16 -21
- data/app/assets/javascripts/twitter/bootstrap/tab.js +7 -17
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +52 -39
- data/app/assets/javascripts/twitter/bootstrap/transition.js +11 -19
- data/lib/generators/bootswatch/install/templates/loader.js.tt +1 -1
- data/lib/generators/bootswatch/install/templates/mixins.less.tt +130 -49
- data/lib/generators/bootswatch/install/templates/variables.less.tt +346 -161
- data/lib/twitter/bootswatch/rails/version.rb +1 -1
- data/vendor/toolkit/twitter/bootstrap/badges.less +4 -0
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +4 -1
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +10 -11
- data/vendor/toolkit/twitter/bootstrap/buttons.less +8 -8
- data/vendor/toolkit/twitter/bootstrap/code.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +28 -2
- data/vendor/toolkit/twitter/bootstrap/forms.less +82 -38
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +1 -5
- data/vendor/toolkit/twitter/bootstrap/grid.less +26 -5
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +39 -18
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +3 -5
- data/vendor/toolkit/twitter/bootstrap/list-group.less +25 -3
- data/vendor/toolkit/twitter/bootstrap/mixins.less +130 -49
- data/vendor/toolkit/twitter/bootstrap/modals.less +16 -7
- data/vendor/toolkit/twitter/bootstrap/navbar.less +24 -20
- data/vendor/toolkit/twitter/bootstrap/navs.less +2 -2
- data/vendor/toolkit/twitter/bootstrap/normalize.less +139 -122
- data/vendor/toolkit/twitter/bootstrap/pager.less +5 -5
- data/vendor/toolkit/twitter/bootstrap/pagination.less +6 -3
- data/vendor/toolkit/twitter/bootstrap/panels.less +64 -16
- data/vendor/toolkit/twitter/bootstrap/print.less +0 -4
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +13 -129
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +17 -2
- data/vendor/toolkit/twitter/bootstrap/tables.less +3 -1
- data/vendor/toolkit/twitter/bootstrap/theme.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/type.less +78 -63
- data/vendor/toolkit/twitter/bootstrap/variables.less +346 -161
- data/vendor/toolkit/twitter/bootstrap/wells.less +1 -1
- metadata +2 -3
- data/lib/generators/bootswatch/import/import_generator.rb +0 -49
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: modal.js v3.0
|
2
|
+
* Bootstrap: modal.js v3.1.0
|
3
3
|
* http://getbootstrap.com/javascript/#modals
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// MODAL CLASS DEFINITION
|
24
14
|
// ======================
|
@@ -29,13 +19,19 @@
|
|
29
19
|
this.$backdrop =
|
30
20
|
this.isShown = null
|
31
21
|
|
32
|
-
if (this.options.remote)
|
22
|
+
if (this.options.remote) {
|
23
|
+
this.$element
|
24
|
+
.find('.modal-content')
|
25
|
+
.load(this.options.remote, $.proxy(function () {
|
26
|
+
this.$element.trigger('loaded.bs.modal')
|
27
|
+
}, this))
|
28
|
+
}
|
33
29
|
}
|
34
30
|
|
35
31
|
Modal.DEFAULTS = {
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
backdrop: true,
|
33
|
+
keyboard: true,
|
34
|
+
show: true
|
39
35
|
}
|
40
36
|
|
41
37
|
Modal.prototype.toggle = function (_relatedTarget) {
|
@@ -54,7 +50,7 @@
|
|
54
50
|
|
55
51
|
this.escape()
|
56
52
|
|
57
|
-
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
53
|
+
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
58
54
|
|
59
55
|
this.backdrop(function () {
|
60
56
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
@@ -63,7 +59,9 @@
|
|
63
59
|
that.$element.appendTo(document.body) // don't move modals dom position
|
64
60
|
}
|
65
61
|
|
66
|
-
that.$element
|
62
|
+
that.$element
|
63
|
+
.show()
|
64
|
+
.scrollTop(0)
|
67
65
|
|
68
66
|
if (transition) {
|
69
67
|
that.$element[0].offsetWidth // force reflow
|
@@ -105,7 +103,7 @@
|
|
105
103
|
this.$element
|
106
104
|
.removeClass('in')
|
107
105
|
.attr('aria-hidden', true)
|
108
|
-
.off('click.dismiss.modal')
|
106
|
+
.off('click.dismiss.bs.modal')
|
109
107
|
|
110
108
|
$.support.transition && this.$element.hasClass('fade') ?
|
111
109
|
this.$element
|
@@ -149,7 +147,6 @@
|
|
149
147
|
}
|
150
148
|
|
151
149
|
Modal.prototype.backdrop = function (callback) {
|
152
|
-
var that = this
|
153
150
|
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
154
151
|
|
155
152
|
if (this.isShown && this.options.backdrop) {
|
@@ -158,7 +155,7 @@
|
|
158
155
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
159
156
|
.appendTo(document.body)
|
160
157
|
|
161
|
-
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
158
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
162
159
|
if (e.target !== e.currentTarget) return
|
163
160
|
this.options.backdrop == 'static'
|
164
161
|
? this.$element[0].focus.call(this.$element[0])
|
@@ -180,7 +177,7 @@
|
|
180
177
|
} else if (!this.isShown && this.$backdrop) {
|
181
178
|
this.$backdrop.removeClass('in')
|
182
179
|
|
183
|
-
$.support.transition && this.$element.hasClass('fade')?
|
180
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
184
181
|
this.$backdrop
|
185
182
|
.one($.support.transition.end, callback)
|
186
183
|
.emulateTransitionEnd(150) :
|
@@ -228,9 +225,9 @@
|
|
228
225
|
var $this = $(this)
|
229
226
|
var href = $this.attr('href')
|
230
227
|
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
231
|
-
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
228
|
+
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
232
229
|
|
233
|
-
e.preventDefault()
|
230
|
+
if ($this.is('a')) e.preventDefault()
|
234
231
|
|
235
232
|
$target
|
236
233
|
.modal(option, this)
|
@@ -240,7 +237,7 @@
|
|
240
237
|
})
|
241
238
|
|
242
239
|
$(document)
|
243
|
-
.on('show.bs.modal',
|
240
|
+
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
244
241
|
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
245
242
|
|
246
243
|
}(jQuery);
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: popover.js v3.0
|
2
|
+
* Bootstrap: popover.js v3.1.0
|
3
3
|
* http://getbootstrap.com/javascript/#popovers
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// POPOVER PUBLIC CLASS DEFINITION
|
24
14
|
// ===============================
|
@@ -29,11 +19,11 @@
|
|
29
19
|
|
30
20
|
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
31
21
|
|
32
|
-
Popover.DEFAULTS = $.extend({}
|
33
|
-
placement: 'right'
|
34
|
-
|
35
|
-
|
36
|
-
|
22
|
+
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
23
|
+
placement: 'right',
|
24
|
+
trigger: 'click',
|
25
|
+
content: '',
|
26
|
+
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
37
27
|
})
|
38
28
|
|
39
29
|
|
@@ -54,7 +44,9 @@
|
|
54
44
|
var content = this.getContent()
|
55
45
|
|
56
46
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
57
|
-
$tip.find('.popover-content')[
|
47
|
+
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
|
48
|
+
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
49
|
+
](content)
|
58
50
|
|
59
51
|
$tip.removeClass('fade top bottom left right in')
|
60
52
|
|
@@ -98,6 +90,7 @@
|
|
98
90
|
var data = $this.data('bs.popover')
|
99
91
|
var options = typeof option == 'object' && option
|
100
92
|
|
93
|
+
if (!data && option == 'destroy') return
|
101
94
|
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
102
95
|
if (typeof option == 'string') data[option]()
|
103
96
|
})
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: scrollspy.js v3.0
|
2
|
+
* Bootstrap: scrollspy.js v3.1.0
|
3
3
|
* http://getbootstrap.com/javascript/#scrollspy
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// SCROLLSPY CLASS DEFINITION
|
24
14
|
// ==========================
|
@@ -58,10 +48,11 @@
|
|
58
48
|
.map(function () {
|
59
49
|
var $el = $(this)
|
60
50
|
var href = $el.data('target') || $el.attr('href')
|
61
|
-
var $href =
|
51
|
+
var $href = /^#./.test(href) && $(href)
|
62
52
|
|
63
53
|
return ($href
|
64
54
|
&& $href.length
|
55
|
+
&& $href.is(':visible')
|
65
56
|
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
66
57
|
})
|
67
58
|
.sort(function (a, b) { return a[0] - b[0] })
|
@@ -84,6 +75,10 @@
|
|
84
75
|
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
85
76
|
}
|
86
77
|
|
78
|
+
if (activeTarget && scrollTop <= offsets[0]) {
|
79
|
+
return activeTarget != (i = targets[0]) && this.activate(i)
|
80
|
+
}
|
81
|
+
|
87
82
|
for (i = offsets.length; i--;) {
|
88
83
|
activeTarget != targets[i]
|
89
84
|
&& scrollTop >= offsets[i]
|
@@ -96,18 +91,18 @@
|
|
96
91
|
this.activeTarget = target
|
97
92
|
|
98
93
|
$(this.selector)
|
99
|
-
.
|
94
|
+
.parentsUntil(this.options.target, '.active')
|
100
95
|
.removeClass('active')
|
101
96
|
|
102
|
-
var selector = this.selector
|
103
|
-
|
104
|
-
|
97
|
+
var selector = this.selector +
|
98
|
+
'[data-target="' + target + '"],' +
|
99
|
+
this.selector + '[href="' + target + '"]'
|
105
100
|
|
106
101
|
var active = $(selector)
|
107
102
|
.parents('li')
|
108
103
|
.addClass('active')
|
109
104
|
|
110
|
-
if (active.parent('.dropdown-menu').length)
|
105
|
+
if (active.parent('.dropdown-menu').length) {
|
111
106
|
active = active
|
112
107
|
.closest('li.dropdown')
|
113
108
|
.addClass('active')
|
@@ -1,24 +1,14 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: tab.js v3.0
|
2
|
+
* Bootstrap: tab.js v3.1.0
|
3
3
|
* http://getbootstrap.com/javascript/#tabs
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
18
7
|
* ======================================================================== */
|
19
8
|
|
20
9
|
|
21
|
-
+function ($) {
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
22
12
|
|
23
13
|
// TAB CLASS DEFINITION
|
24
14
|
// ====================
|
@@ -53,8 +43,8 @@
|
|
53
43
|
this.activate($this.parent('li'), $ul)
|
54
44
|
this.activate($target, $target.parent(), function () {
|
55
45
|
$this.trigger({
|
56
|
-
type: 'shown.bs.tab'
|
57
|
-
|
46
|
+
type: 'shown.bs.tab',
|
47
|
+
relatedTarget: previous
|
58
48
|
})
|
59
49
|
})
|
60
50
|
}
|
@@ -1,25 +1,15 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: tooltip.js v3.0
|
2
|
+
* Bootstrap: tooltip.js v3.1.0
|
3
3
|
* http://getbootstrap.com/javascript/#tooltip
|
4
4
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
5
5
|
* ========================================================================
|
6
|
-
* Copyright
|
7
|
-
*
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
* you may not use this file except in compliance with the License.
|
10
|
-
* You may obtain a copy of the License at
|
11
|
-
*
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
*
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
-
* See the License for the specific language governing permissions and
|
18
|
-
* limitations under the License.
|
6
|
+
* Copyright 2011-2014 Twitter, Inc.
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
19
8
|
* ======================================================================== */
|
20
9
|
|
21
10
|
|
22
|
-
+function ($) {
|
11
|
+
+function ($) {
|
12
|
+
'use strict';
|
23
13
|
|
24
14
|
// TOOLTIP PUBLIC CLASS DEFINITION
|
25
15
|
// ===============================
|
@@ -36,15 +26,15 @@
|
|
36
26
|
}
|
37
27
|
|
38
28
|
Tooltip.DEFAULTS = {
|
39
|
-
animation: true
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
29
|
+
animation: true,
|
30
|
+
placement: 'top',
|
31
|
+
selector: false,
|
32
|
+
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
33
|
+
trigger: 'hover focus',
|
34
|
+
title: '',
|
35
|
+
delay: 0,
|
36
|
+
html: false,
|
37
|
+
container: false
|
48
38
|
}
|
49
39
|
|
50
40
|
Tooltip.prototype.init = function (type, element, options) {
|
@@ -61,8 +51,8 @@
|
|
61
51
|
if (trigger == 'click') {
|
62
52
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
63
53
|
} else if (trigger != 'manual') {
|
64
|
-
var eventIn = trigger == 'hover' ? 'mouseenter' : '
|
65
|
-
var eventOut = trigger == 'hover' ? 'mouseleave' : '
|
54
|
+
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
55
|
+
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
66
56
|
|
67
57
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
68
58
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
@@ -83,8 +73,8 @@
|
|
83
73
|
|
84
74
|
if (options.delay && typeof options.delay == 'number') {
|
85
75
|
options.delay = {
|
86
|
-
show: options.delay
|
87
|
-
|
76
|
+
show: options.delay,
|
77
|
+
hide: options.delay
|
88
78
|
}
|
89
79
|
}
|
90
80
|
|
@@ -133,12 +123,13 @@
|
|
133
123
|
}
|
134
124
|
|
135
125
|
Tooltip.prototype.show = function () {
|
136
|
-
var e = $.Event('show.bs.'+ this.type)
|
126
|
+
var e = $.Event('show.bs.' + this.type)
|
137
127
|
|
138
128
|
if (this.hasContent() && this.enabled) {
|
139
129
|
this.$element.trigger(e)
|
140
130
|
|
141
131
|
if (e.isDefaultPrevented()) return
|
132
|
+
var that = this;
|
142
133
|
|
143
134
|
var $tip = this.tip()
|
144
135
|
|
@@ -188,11 +179,21 @@
|
|
188
179
|
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
189
180
|
|
190
181
|
this.applyPlacement(calculatedOffset, placement)
|
191
|
-
this
|
182
|
+
this.hoverState = null
|
183
|
+
|
184
|
+
var complete = function() {
|
185
|
+
that.$element.trigger('shown.bs.' + that.type)
|
186
|
+
}
|
187
|
+
|
188
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
189
|
+
$tip
|
190
|
+
.one($.support.transition.end, complete)
|
191
|
+
.emulateTransitionEnd(150) :
|
192
|
+
complete()
|
192
193
|
}
|
193
194
|
}
|
194
195
|
|
195
|
-
Tooltip.prototype.applyPlacement = function(offset, placement) {
|
196
|
+
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
196
197
|
var replace
|
197
198
|
var $tip = this.tip()
|
198
199
|
var width = $tip[0].offsetWidth
|
@@ -209,9 +210,18 @@
|
|
209
210
|
offset.top = offset.top + marginTop
|
210
211
|
offset.left = offset.left + marginLeft
|
211
212
|
|
212
|
-
|
213
|
-
|
214
|
-
|
213
|
+
// $.fn.offset doesn't round pixel values
|
214
|
+
// so we use setOffset directly with our own function B-0
|
215
|
+
$.offset.setOffset($tip[0], $.extend({
|
216
|
+
using: function (props) {
|
217
|
+
$tip.css({
|
218
|
+
top: Math.round(props.top),
|
219
|
+
left: Math.round(props.left)
|
220
|
+
})
|
221
|
+
}
|
222
|
+
}, offset), 0)
|
223
|
+
|
224
|
+
$tip.addClass('in')
|
215
225
|
|
216
226
|
// check to see if placing tip in new offset caused the tip to resize itself
|
217
227
|
var actualWidth = $tip[0].offsetWidth
|
@@ -243,8 +253,8 @@
|
|
243
253
|
if (replace) $tip.offset(offset)
|
244
254
|
}
|
245
255
|
|
246
|
-
Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
|
247
|
-
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) +
|
256
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
257
|
+
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
248
258
|
}
|
249
259
|
|
250
260
|
Tooltip.prototype.setContent = function () {
|
@@ -262,6 +272,7 @@
|
|
262
272
|
|
263
273
|
function complete() {
|
264
274
|
if (that.hoverState != 'in') $tip.detach()
|
275
|
+
that.$element.trigger('hidden.bs.' + that.type)
|
265
276
|
}
|
266
277
|
|
267
278
|
this.$element.trigger(e)
|
@@ -276,7 +287,7 @@
|
|
276
287
|
.emulateTransitionEnd(150) :
|
277
288
|
complete()
|
278
289
|
|
279
|
-
this
|
290
|
+
this.hoverState = null
|
280
291
|
|
281
292
|
return this
|
282
293
|
}
|
@@ -295,8 +306,8 @@
|
|
295
306
|
Tooltip.prototype.getPosition = function () {
|
296
307
|
var el = this.$element[0]
|
297
308
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
298
|
-
width: el.offsetWidth
|
299
|
-
|
309
|
+
width: el.offsetWidth,
|
310
|
+
height: el.offsetHeight
|
300
311
|
}, this.$element.offset())
|
301
312
|
}
|
302
313
|
|
@@ -352,6 +363,7 @@
|
|
352
363
|
}
|
353
364
|
|
354
365
|
Tooltip.prototype.destroy = function () {
|
366
|
+
clearTimeout(this.timeout)
|
355
367
|
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
356
368
|
}
|
357
369
|
|
@@ -367,6 +379,7 @@
|
|
367
379
|
var data = $this.data('bs.tooltip')
|
368
380
|
var options = typeof option == 'object' && option
|
369
381
|
|
382
|
+
if (!data && option == 'destroy') return
|
370
383
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
371
384
|
if (typeof option == 'string') data[option]()
|
372
385
|
})
|