less-rails-bootstrap 2.3.3 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +7 -11
- data/lib/less/rails/bootstrap/version.rb +1 -1
- data/scripts/update_bootstrap.sh +37 -8
- data/test/cases/usage_css_spec.rb +15 -12
- data/test/cases/usage_js_spec.rb +4 -4
- data/test/dummy_app/app/assets/stylesheets/fonts.css.less +2 -0
- data/test/dummy_app/app/assets/stylesheets/framework.css.less +4 -2
- data/test/dummy_app/app/assets/stylesheets/individual.css.less +2 -2
- data/test/spec_helper.rb +1 -2
- data/vendor/assets/javascripts/twitter/bootstrap.js +0 -1
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +58 -49
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +36 -37
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +41 -39
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +131 -125
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +108 -96
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +72 -87
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +149 -155
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +60 -59
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +103 -107
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +73 -82
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +258 -255
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +34 -38
- data/vendor/frameworks/twitter/bootstrap/accordion.less +9 -12
- data/vendor/frameworks/twitter/bootstrap/alerts.less +43 -53
- data/vendor/frameworks/twitter/bootstrap/bootstrap.less +21 -21
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.less +7 -8
- data/vendor/frameworks/twitter/bootstrap/button-groups.less +93 -151
- data/vendor/frameworks/twitter/bootstrap/buttons.less +93 -164
- data/vendor/frameworks/twitter/bootstrap/carousel.less +110 -63
- data/vendor/frameworks/twitter/bootstrap/close.less +18 -17
- data/vendor/frameworks/twitter/bootstrap/code.less +14 -20
- data/vendor/frameworks/twitter/bootstrap/component-animations.less +10 -3
- data/vendor/frameworks/twitter/bootstrap/dropdowns.less +66 -143
- data/vendor/frameworks/twitter/bootstrap/forms.less +281 -548
- data/vendor/frameworks/twitter/bootstrap/grid.less +194 -11
- data/vendor/frameworks/twitter/bootstrap/media.less +8 -7
- data/vendor/frameworks/twitter/bootstrap/mixins.less +290 -446
- data/vendor/frameworks/twitter/bootstrap/modals.less +92 -51
- data/vendor/frameworks/twitter/bootstrap/navbar.less +285 -402
- data/vendor/frameworks/twitter/bootstrap/navs.less +176 -348
- data/vendor/frameworks/twitter/bootstrap/pager.less +45 -33
- data/vendor/frameworks/twitter/bootstrap/pagination.less +89 -104
- data/vendor/frameworks/twitter/bootstrap/popovers.less +53 -51
- data/vendor/frameworks/twitter/bootstrap/progress-bars.less +28 -45
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +92 -32
- data/vendor/frameworks/twitter/bootstrap/scaffolding.less +60 -18
- data/vendor/frameworks/twitter/bootstrap/tables.less +131 -164
- data/vendor/frameworks/twitter/bootstrap/thumbnails.less +20 -31
- data/vendor/frameworks/twitter/bootstrap/tooltip.less +45 -20
- data/vendor/frameworks/twitter/bootstrap/type.less +84 -99
- data/vendor/frameworks/twitter/bootstrap/utilities.less +17 -5
- data/vendor/frameworks/twitter/bootstrap/variables.less +446 -179
- data/vendor/frameworks/twitter/bootstrap/wells.less +5 -5
- metadata +41 -44
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.css.less +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
- data/vendor/frameworks/twitter/bootstrap.less +0 -1
- data/vendor/frameworks/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/frameworks/twitter/bootstrap/layouts.less +0 -16
- data/vendor/frameworks/twitter/bootstrap/reset.less +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive.less +0 -48
- data/vendor/frameworks/twitter/bootstrap/sprites.less +0 -197
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: modal.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#modals
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,210 +15,200 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* MODAL CLASS DEFINITION
|
27
|
-
* ====================== */
|
23
|
+
// MODAL CLASS DEFINITION
|
24
|
+
// ======================
|
28
25
|
|
29
26
|
var Modal = function (element, options) {
|
30
|
-
this.options
|
31
|
-
this.$element
|
32
|
-
|
33
|
-
this.
|
34
|
-
}
|
27
|
+
this.options = options
|
28
|
+
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
29
|
+
this.$backdrop =
|
30
|
+
this.isShown = null
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
constructor: Modal
|
39
|
-
|
40
|
-
, toggle: function () {
|
41
|
-
return this[!this.isShown ? 'show' : 'hide']()
|
42
|
-
}
|
43
|
-
|
44
|
-
, show: function () {
|
45
|
-
var that = this
|
46
|
-
, e = $.Event('show')
|
47
|
-
|
48
|
-
this.$element.trigger(e)
|
32
|
+
if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
|
33
|
+
}
|
49
34
|
|
50
|
-
|
35
|
+
Modal.DEFAULTS = {
|
36
|
+
backdrop: true
|
37
|
+
, keyboard: true
|
38
|
+
, show: true
|
39
|
+
}
|
51
40
|
|
52
|
-
|
41
|
+
Modal.prototype.toggle = function () {
|
42
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
43
|
+
}
|
53
44
|
|
54
|
-
|
45
|
+
Modal.prototype.show = function () {
|
46
|
+
var that = this
|
47
|
+
var e = $.Event('show.bs.modal')
|
55
48
|
|
56
|
-
|
57
|
-
var transition = $.support.transition && that.$element.hasClass('fade')
|
49
|
+
this.$element.trigger(e)
|
58
50
|
|
59
|
-
|
60
|
-
that.$element.appendTo(document.body) //don't move modals dom position
|
61
|
-
}
|
51
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
62
52
|
|
63
|
-
|
53
|
+
this.isShown = true
|
64
54
|
|
65
|
-
|
66
|
-
that.$element[0].offsetWidth // force reflow
|
67
|
-
}
|
55
|
+
this.escape()
|
68
56
|
|
69
|
-
|
70
|
-
|
71
|
-
.attr('aria-hidden', false)
|
57
|
+
this.backdrop(function () {
|
58
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
72
59
|
|
73
|
-
|
60
|
+
if (!that.$element.parent().length) {
|
61
|
+
that.$element.appendTo(document.body) // don't move modals dom position
|
62
|
+
}
|
74
63
|
|
75
|
-
|
76
|
-
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
|
77
|
-
that.$element.focus().trigger('shown')
|
64
|
+
that.$element.show()
|
78
65
|
|
79
|
-
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
80
68
|
}
|
81
69
|
|
82
|
-
|
83
|
-
|
70
|
+
that.$element
|
71
|
+
.addClass('in')
|
72
|
+
.attr('aria-hidden', false)
|
84
73
|
|
85
|
-
|
74
|
+
that.enforceFocus()
|
86
75
|
|
87
|
-
|
76
|
+
transition ?
|
77
|
+
that.$element
|
78
|
+
.one($.support.transition.end, function () {
|
79
|
+
that.$element.focus().trigger('shown.bs.modal')
|
80
|
+
})
|
81
|
+
.emulateTransitionEnd(300) :
|
82
|
+
that.$element.focus().trigger('shown.bs.modal')
|
83
|
+
})
|
84
|
+
}
|
88
85
|
|
89
|
-
|
86
|
+
Modal.prototype.hide = function (e) {
|
87
|
+
if (e) e.preventDefault()
|
90
88
|
|
91
|
-
|
89
|
+
e = $.Event('hide.bs.modal')
|
92
90
|
|
93
|
-
|
91
|
+
this.$element.trigger(e)
|
94
92
|
|
95
|
-
|
93
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
96
94
|
|
97
|
-
|
95
|
+
this.isShown = false
|
98
96
|
|
99
|
-
|
100
|
-
.removeClass('in')
|
101
|
-
.attr('aria-hidden', true)
|
97
|
+
this.escape()
|
102
98
|
|
103
|
-
|
104
|
-
this.hideWithTransition() :
|
105
|
-
this.hideModal()
|
106
|
-
}
|
99
|
+
$(document).off('focusin.bs.modal')
|
107
100
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
112
|
-
that.$element.focus()
|
113
|
-
}
|
114
|
-
})
|
115
|
-
}
|
101
|
+
this.$element
|
102
|
+
.removeClass('in')
|
103
|
+
.attr('aria-hidden', true)
|
116
104
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
105
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
106
|
+
this.$element
|
107
|
+
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
108
|
+
.emulateTransitionEnd(300) :
|
109
|
+
this.hideModal()
|
110
|
+
}
|
111
|
+
|
112
|
+
Modal.prototype.enforceFocus = function () {
|
113
|
+
$(document)
|
114
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
115
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
116
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
117
|
+
this.$element.focus()
|
125
118
|
}
|
126
|
-
}
|
119
|
+
}, this))
|
120
|
+
}
|
127
121
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
that.hideModal()
|
138
|
-
})
|
139
|
-
}
|
122
|
+
Modal.prototype.escape = function () {
|
123
|
+
if (this.isShown && this.options.keyboard) {
|
124
|
+
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
125
|
+
e.which == 27 && this.hide()
|
126
|
+
}, this))
|
127
|
+
} else if (!this.isShown) {
|
128
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
129
|
+
}
|
130
|
+
}
|
140
131
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
132
|
+
Modal.prototype.hideModal = function () {
|
133
|
+
var that = this
|
134
|
+
this.$element.hide()
|
135
|
+
this.backdrop(function () {
|
136
|
+
that.removeBackdrop()
|
137
|
+
that.$element.trigger('hidden.bs.modal')
|
138
|
+
})
|
139
|
+
}
|
149
140
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
141
|
+
Modal.prototype.removeBackdrop = function () {
|
142
|
+
this.$backdrop && this.$backdrop.remove()
|
143
|
+
this.$backdrop = null
|
144
|
+
}
|
154
145
|
|
155
|
-
|
156
|
-
|
157
|
-
|
146
|
+
Modal.prototype.backdrop = function (callback) {
|
147
|
+
var that = this
|
148
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
158
149
|
|
159
|
-
|
160
|
-
|
150
|
+
if (this.isShown && this.options.backdrop) {
|
151
|
+
var doAnimate = $.support.transition && animate
|
161
152
|
|
162
|
-
|
163
|
-
|
153
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
154
|
+
.appendTo(document.body)
|
164
155
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
)
|
156
|
+
this.$element.on('click', $.proxy(function (e) {
|
157
|
+
if (e.target !== e.currentTarget) return
|
158
|
+
this.options.backdrop == 'static'
|
159
|
+
? this.$element[0].focus.call(this.$element[0])
|
160
|
+
: this.hide.call(this)
|
161
|
+
}, this))
|
170
162
|
|
171
|
-
|
163
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
172
164
|
|
173
|
-
|
165
|
+
this.$backdrop.addClass('in')
|
174
166
|
|
175
|
-
|
167
|
+
if (!callback) return
|
176
168
|
|
177
|
-
|
178
|
-
|
179
|
-
|
169
|
+
doAnimate ?
|
170
|
+
this.$backdrop
|
171
|
+
.one($.support.transition.end, callback)
|
172
|
+
.emulateTransitionEnd(150) :
|
173
|
+
callback()
|
180
174
|
|
181
|
-
|
182
|
-
|
175
|
+
} else if (!this.isShown && this.$backdrop) {
|
176
|
+
this.$backdrop.removeClass('in')
|
183
177
|
|
184
|
-
|
185
|
-
|
186
|
-
|
178
|
+
$.support.transition && this.$element.hasClass('fade')?
|
179
|
+
this.$backdrop
|
180
|
+
.one($.support.transition.end, callback)
|
181
|
+
.emulateTransitionEnd(150) :
|
182
|
+
callback()
|
187
183
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
}
|
184
|
+
} else if (callback) {
|
185
|
+
callback()
|
186
|
+
}
|
192
187
|
}
|
193
188
|
|
194
189
|
|
195
|
-
|
196
|
-
|
190
|
+
// MODAL PLUGIN DEFINITION
|
191
|
+
// =======================
|
197
192
|
|
198
193
|
var old = $.fn.modal
|
199
194
|
|
200
195
|
$.fn.modal = function (option) {
|
201
196
|
return this.each(function () {
|
202
|
-
var $this
|
203
|
-
|
204
|
-
|
205
|
-
|
197
|
+
var $this = $(this)
|
198
|
+
var data = $this.data('bs.modal')
|
199
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
200
|
+
|
201
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
206
202
|
if (typeof option == 'string') data[option]()
|
207
203
|
else if (options.show) data.show()
|
208
204
|
})
|
209
205
|
}
|
210
206
|
|
211
|
-
$.fn.modal.defaults = {
|
212
|
-
backdrop: true
|
213
|
-
, keyboard: true
|
214
|
-
, show: true
|
215
|
-
}
|
216
|
-
|
217
207
|
$.fn.modal.Constructor = Modal
|
218
208
|
|
219
209
|
|
220
|
-
|
221
|
-
|
210
|
+
// MODAL NO CONFLICT
|
211
|
+
// =================
|
222
212
|
|
223
213
|
$.fn.modal.noConflict = function () {
|
224
214
|
$.fn.modal = old
|
@@ -226,22 +216,26 @@
|
|
226
216
|
}
|
227
217
|
|
228
218
|
|
229
|
-
|
230
|
-
|
219
|
+
// MODAL DATA-API
|
220
|
+
// ==============
|
231
221
|
|
232
|
-
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
233
|
-
var $this
|
234
|
-
|
235
|
-
|
236
|
-
|
222
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
223
|
+
var $this = $(this)
|
224
|
+
var href = $this.attr('href')
|
225
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
226
|
+
var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
237
227
|
|
238
228
|
e.preventDefault()
|
239
229
|
|
240
230
|
$target
|
241
231
|
.modal(option)
|
242
232
|
.one('hide', function () {
|
243
|
-
$this.focus()
|
233
|
+
$this.is(':visible') && $this.focus()
|
244
234
|
})
|
245
235
|
})
|
246
236
|
|
237
|
+
var $body = $(document.body)
|
238
|
+
.on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
|
239
|
+
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
|
240
|
+
|
247
241
|
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: popover.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#popovers
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,96 +15,97 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* POPOVER PUBLIC CLASS DEFINITION
|
27
|
-
* =============================== */
|
23
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
24
|
+
// ===============================
|
28
25
|
|
29
26
|
var Popover = function (element, options) {
|
30
27
|
this.init('popover', element, options)
|
31
28
|
}
|
32
29
|
|
30
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
33
31
|
|
34
|
-
|
35
|
-
|
32
|
+
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
33
|
+
placement: 'right'
|
34
|
+
, trigger: 'click'
|
35
|
+
, content: ''
|
36
|
+
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
37
|
+
})
|
36
38
|
|
37
|
-
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
38
39
|
|
39
|
-
|
40
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
41
|
+
// ================================
|
40
42
|
|
41
|
-
|
42
|
-
var $tip = this.tip()
|
43
|
-
, title = this.getTitle()
|
44
|
-
, content = this.getContent()
|
43
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
45
44
|
|
46
|
-
|
47
|
-
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
45
|
+
Popover.prototype.constructor = Popover
|
48
46
|
|
49
|
-
|
50
|
-
|
47
|
+
Popover.prototype.getDefaults = function () {
|
48
|
+
return Popover.DEFAULTS
|
49
|
+
}
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
Popover.prototype.setContent = function () {
|
52
|
+
var $tip = this.tip()
|
53
|
+
var title = this.getTitle()
|
54
|
+
var content = this.getContent()
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
, $e = this.$element
|
59
|
-
, o = this.options
|
56
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
57
|
+
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
60
58
|
|
61
|
-
|
62
|
-
|| $e.attr('data-content')
|
59
|
+
$tip.removeClass('fade top bottom left right in')
|
63
60
|
|
64
|
-
|
65
|
-
|
61
|
+
$tip.find('.popover-title:empty').hide()
|
62
|
+
}
|
66
63
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
}
|
71
|
-
return this.$tip
|
72
|
-
}
|
64
|
+
Popover.prototype.hasContent = function () {
|
65
|
+
return this.getTitle() || this.getContent()
|
66
|
+
}
|
73
67
|
|
74
|
-
|
75
|
-
|
76
|
-
|
68
|
+
Popover.prototype.getContent = function () {
|
69
|
+
var $e = this.$element
|
70
|
+
var o = this.options
|
77
71
|
|
78
|
-
|
72
|
+
return $e.attr('data-content')
|
73
|
+
|| (typeof o.content == 'function' ?
|
74
|
+
o.content.call($e[0]) :
|
75
|
+
o.content)
|
76
|
+
}
|
79
77
|
|
78
|
+
Popover.prototype.tip = function () {
|
79
|
+
if (!this.$tip) this.$tip = $(this.options.template)
|
80
|
+
return this.$tip
|
81
|
+
}
|
82
|
+
|
83
|
+
Popover.prototype.destroy = function () {
|
84
|
+
this.hide().$element.off('.' + this.type).removeData(this.type)
|
85
|
+
}
|
80
86
|
|
81
|
-
|
82
|
-
|
87
|
+
|
88
|
+
// POPOVER PLUGIN DEFINITION
|
89
|
+
// =========================
|
83
90
|
|
84
91
|
var old = $.fn.popover
|
85
92
|
|
86
93
|
$.fn.popover = function (option) {
|
87
94
|
return this.each(function () {
|
88
|
-
var $this
|
89
|
-
|
90
|
-
|
91
|
-
|
95
|
+
var $this = $(this)
|
96
|
+
var data = $this.data('bs.popover')
|
97
|
+
var options = typeof option == 'object' && option
|
98
|
+
|
99
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
92
100
|
if (typeof option == 'string') data[option]()
|
93
101
|
})
|
94
102
|
}
|
95
103
|
|
96
104
|
$.fn.popover.Constructor = Popover
|
97
105
|
|
98
|
-
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
99
|
-
placement: 'right'
|
100
|
-
, trigger: 'click'
|
101
|
-
, content: ''
|
102
|
-
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
103
|
-
})
|
104
|
-
|
105
106
|
|
106
|
-
|
107
|
-
|
107
|
+
// POPOVER NO CONFLICT
|
108
|
+
// ===================
|
108
109
|
|
109
110
|
$.fn.popover.noConflict = function () {
|
110
111
|
$.fn.popover = old
|