anjlab-bootstrap-rails 2.3.1.2 → 3.0.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/Rakefile +42 -26
- data/lib/bootstrap-rails.rb +5 -6
- data/lib/bootstrap-rails/engine.rb +2 -9
- data/lib/bootstrap-rails/version.rb +1 -1
- data/test/test_helper.rb +2 -2
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +175 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +4 -5
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +50 -47
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +32 -35
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +37 -37
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +123 -127
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +81 -95
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +61 -81
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +146 -151
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +53 -58
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +99 -105
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +70 -81
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +246 -254
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +24 -37
- data/vendor/assets/stylesheets/twitter/bootstrap.scss +1 -1
- data/vendor/{frameworks/twitter/bootstrap/accordion.scss → assets/stylesheets/twitter/bootstrap/_accordion.scss} +2 -2
- data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +92 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_badges.scss +58 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +64 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +28 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +170 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +160 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +191 -0
- data/vendor/{frameworks/twitter/bootstrap/close.scss → assets/stylesheets/twitter/bootstrap/_close.scss} +7 -6
- data/vendor/{frameworks/twitter/bootstrap/code.scss → assets/stylesheets/twitter/bootstrap/_code.scss} +14 -14
- data/vendor/{frameworks/twitter/bootstrap/component-animations.scss → assets/stylesheets/twitter/bootstrap/_component-animations.scss} +1 -0
- data/vendor/{frameworks/twitter/bootstrap/dropdowns.scss → assets/stylesheets/twitter/bootstrap/_dropdowns.scss} +46 -57
- data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +464 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +200 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +65 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +32 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +70 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/media.scss → assets/stylesheets/twitter/bootstrap/_media.scss} +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +510 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +137 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +356 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +249 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_normalize.scss +396 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +54 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +87 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_panels.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/popovers.scss → assets/stylesheets/twitter/bootstrap/_popovers.scss} +32 -32
- data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +74 -0
- data/vendor/{frameworks/twitter/bootstrap/progress-bars.scss → assets/stylesheets/twitter/bootstrap/_progress-bars.scss} +40 -44
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +77 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +83 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +242 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +43 -0
- data/vendor/{frameworks/twitter/bootstrap/tooltip.scss → assets/stylesheets/twitter/bootstrap/_tooltip.scss} +20 -19
- data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +253 -0
- data/vendor/{frameworks/twitter/bootstrap/utilities.scss → assets/stylesheets/twitter/bootstrap/_utilities.scss} +17 -5
- data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +416 -0
- data/vendor/{frameworks/twitter/bootstrap/wells.scss → assets/stylesheets/twitter/bootstrap/_wells.scss} +5 -5
- metadata +49 -53
- data/lib/bootstrap-rails/ie_hex_str.rb +0 -16
- data/test/ie_hex_str_test.rb +0 -26
- data/vendor/assets/images/twitter/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap/alerts.scss +0 -79
- data/vendor/frameworks/twitter/bootstrap/bootstrap.scss +0 -63
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.scss +0 -24
- data/vendor/frameworks/twitter/bootstrap/button-groups.scss +0 -230
- data/vendor/frameworks/twitter/bootstrap/buttons.scss +0 -228
- data/vendor/frameworks/twitter/bootstrap/carousel.scss +0 -158
- data/vendor/frameworks/twitter/bootstrap/forms.scss +0 -690
- data/vendor/frameworks/twitter/bootstrap/grid.scss +0 -21
- data/vendor/frameworks/twitter/bootstrap/hero-unit.scss +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.scss +0 -83
- data/vendor/frameworks/twitter/bootstrap/layouts.scss +0 -16
- data/vendor/frameworks/twitter/bootstrap/mixins.scss +0 -704
- data/vendor/frameworks/twitter/bootstrap/modals.scss +0 -95
- data/vendor/frameworks/twitter/bootstrap/navbar.scss +0 -496
- data/vendor/frameworks/twitter/bootstrap/navs.scss +0 -409
- data/vendor/frameworks/twitter/bootstrap/pager.scss +0 -43
- data/vendor/frameworks/twitter/bootstrap/pagination.scss +0 -123
- data/vendor/frameworks/twitter/bootstrap/reset.scss +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.scss +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.scss +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.scss +0 -59
- data/vendor/frameworks/twitter/bootstrap/responsive.scss +0 -48
- data/vendor/frameworks/twitter/bootstrap/scaffolding.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/sprites.scss +0 -197
- data/vendor/frameworks/twitter/bootstrap/tables.scss +0 -235
- data/vendor/frameworks/twitter/bootstrap/thumbnails.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/type.scss +0 -246
- data/vendor/frameworks/twitter/bootstrap/variables.scss +0 -295
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: modal.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#modals
|
4
|
-
*
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,210 +15,201 @@
|
|
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).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
29
|
+
this.$backdrop =
|
30
|
+
this.isShown = null
|
35
31
|
|
36
|
-
|
32
|
+
if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
|
33
|
+
}
|
37
34
|
|
38
|
-
|
35
|
+
Modal.DEFAULTS = {
|
36
|
+
backdrop: true
|
37
|
+
, keyboard: true
|
38
|
+
, show: true
|
39
|
+
}
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
41
|
+
Modal.prototype.toggle = function () {
|
42
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
43
|
+
}
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
Modal.prototype.show = function () {
|
46
|
+
var that = this
|
47
|
+
var e = $.Event('show.bs.modal')
|
47
48
|
|
48
|
-
|
49
|
+
this.$element.trigger(e)
|
49
50
|
|
50
|
-
|
51
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
51
52
|
|
52
|
-
|
53
|
+
this.isShown = true
|
53
54
|
|
54
|
-
|
55
|
+
this.escape()
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
this.backdrop(function () {
|
58
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
if (!that.$element.parent().length) {
|
61
|
+
that.$element.appendTo(document.body) //don't move modals dom position
|
62
|
+
}
|
62
63
|
|
63
|
-
|
64
|
+
that.$element.show()
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
68
|
+
}
|
68
69
|
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
that.$element
|
71
|
+
.addClass('in')
|
72
|
+
.attr('aria-hidden', false)
|
72
73
|
|
73
|
-
|
74
|
+
that.enforceFocus()
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
transition ?
|
77
|
+
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) :
|
78
|
+
that.$element.focus().trigger('shown.bs.modal')
|
78
79
|
|
79
|
-
|
80
|
-
|
80
|
+
})
|
81
|
+
}
|
81
82
|
|
82
|
-
|
83
|
-
|
83
|
+
Modal.prototype.hide = function (e) {
|
84
|
+
if (e) e.preventDefault()
|
84
85
|
|
85
|
-
|
86
|
+
e = $.Event('hide.bs.modal')
|
86
87
|
|
87
|
-
|
88
|
+
this.$element.trigger(e)
|
88
89
|
|
89
|
-
|
90
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
90
91
|
|
91
|
-
|
92
|
+
this.isShown = false
|
92
93
|
|
93
|
-
|
94
|
+
this.escape()
|
94
95
|
|
95
|
-
|
96
|
+
$(document).off('focusin.bs.modal')
|
96
97
|
|
97
|
-
|
98
|
+
this.$element
|
99
|
+
.removeClass('in')
|
100
|
+
.attr('aria-hidden', true)
|
98
101
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
103
|
+
this.hideWithTransition() :
|
104
|
+
this.hideModal()
|
105
|
+
}
|
102
106
|
|
103
|
-
|
104
|
-
|
105
|
-
|
107
|
+
Modal.prototype.enforceFocus = function () {
|
108
|
+
$(document).on('focusin.bs.modal', function (e) {
|
109
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
110
|
+
this.$element.focus()
|
106
111
|
}
|
112
|
+
}, this)
|
113
|
+
}
|
107
114
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
115
|
+
Modal.prototype.escape = function () {
|
116
|
+
if (this.isShown && this.options.keyboard) {
|
117
|
+
this.$element.on('keyup.dismiss.bs.modal', function ( e ) {
|
118
|
+
e.which == 27 && this.hide()
|
119
|
+
}, this)
|
120
|
+
} else if (!this.isShown) {
|
121
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
122
|
+
}
|
123
|
+
}
|
116
124
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
} else if (!this.isShown) {
|
124
|
-
this.$element.off('keyup.dismiss.modal')
|
125
|
-
}
|
126
|
-
}
|
125
|
+
Modal.prototype.hideWithTransition = function () {
|
126
|
+
var that = this
|
127
|
+
var timeout = setTimeout(function () {
|
128
|
+
that.$element.off($.support.transition.end)
|
129
|
+
that.hideModal()
|
130
|
+
}, 500)
|
127
131
|
|
128
|
-
,
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}, 500)
|
134
|
-
|
135
|
-
this.$element.one($.support.transition.end, function () {
|
136
|
-
clearTimeout(timeout)
|
137
|
-
that.hideModal()
|
138
|
-
})
|
139
|
-
}
|
132
|
+
this.$element.one($.support.transition.end, function () {
|
133
|
+
clearTimeout(timeout)
|
134
|
+
that.hideModal()
|
135
|
+
})
|
136
|
+
}
|
140
137
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
138
|
+
Modal.prototype.hideModal = function () {
|
139
|
+
var that = this
|
140
|
+
this.$element.hide()
|
141
|
+
this.backdrop(function () {
|
142
|
+
that.removeBackdrop()
|
143
|
+
that.$element.trigger('hidden.bs.modal')
|
144
|
+
})
|
145
|
+
}
|
149
146
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
147
|
+
Modal.prototype.removeBackdrop = function () {
|
148
|
+
this.$backdrop && this.$backdrop.remove()
|
149
|
+
this.$backdrop = null
|
150
|
+
}
|
154
151
|
|
155
|
-
|
156
|
-
|
157
|
-
|
152
|
+
Modal.prototype.backdrop = function (callback) {
|
153
|
+
var that = this
|
154
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
158
155
|
|
159
|
-
|
160
|
-
|
156
|
+
if (this.isShown && this.options.backdrop) {
|
157
|
+
var doAnimate = $.support.transition && animate
|
161
158
|
|
162
|
-
|
163
|
-
|
159
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
160
|
+
.appendTo(document.body)
|
164
161
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
162
|
+
this.$backdrop.click(
|
163
|
+
this.options.backdrop == 'static' ?
|
164
|
+
$.proxy(this.$element[0].focus, this.$element[0])
|
165
|
+
: $.proxy(this.hide, this)
|
166
|
+
)
|
170
167
|
|
171
|
-
|
168
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
172
169
|
|
173
|
-
|
170
|
+
this.$backdrop.addClass('in')
|
174
171
|
|
175
|
-
|
172
|
+
if (!callback) return
|
176
173
|
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
doAnimate ?
|
175
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
176
|
+
callback()
|
180
177
|
|
181
|
-
|
182
|
-
|
178
|
+
} else if (!this.isShown && this.$backdrop) {
|
179
|
+
this.$backdrop.removeClass('in')
|
183
180
|
|
184
|
-
|
185
|
-
|
186
|
-
|
181
|
+
$.support.transition && this.$element.hasClass('fade')?
|
182
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
183
|
+
callback()
|
187
184
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
}
|
185
|
+
} else if (callback) {
|
186
|
+
callback()
|
187
|
+
}
|
192
188
|
}
|
193
189
|
|
194
190
|
|
195
|
-
|
196
|
-
|
191
|
+
// MODAL PLUGIN DEFINITION
|
192
|
+
// =======================
|
197
193
|
|
198
194
|
var old = $.fn.modal
|
199
195
|
|
200
196
|
$.fn.modal = function (option) {
|
201
197
|
return this.each(function () {
|
202
|
-
var $this
|
203
|
-
|
204
|
-
|
205
|
-
|
198
|
+
var $this = $(this)
|
199
|
+
var data = $this.data('bs.modal')
|
200
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
201
|
+
|
202
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
206
203
|
if (typeof option == 'string') data[option]()
|
207
204
|
else if (options.show) data.show()
|
208
205
|
})
|
209
206
|
}
|
210
207
|
|
211
|
-
$.fn.modal.defaults = {
|
212
|
-
backdrop: true
|
213
|
-
, keyboard: true
|
214
|
-
, show: true
|
215
|
-
}
|
216
|
-
|
217
208
|
$.fn.modal.Constructor = Modal
|
218
209
|
|
219
210
|
|
220
|
-
|
221
|
-
|
211
|
+
// MODAL NO CONFLICT
|
212
|
+
// =================
|
222
213
|
|
223
214
|
$.fn.modal.noConflict = function () {
|
224
215
|
$.fn.modal = old
|
@@ -226,14 +217,14 @@
|
|
226
217
|
}
|
227
218
|
|
228
219
|
|
229
|
-
|
230
|
-
|
220
|
+
// MODAL DATA-API
|
221
|
+
// ==============
|
231
222
|
|
232
|
-
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
233
|
-
var $this
|
234
|
-
|
235
|
-
|
236
|
-
|
223
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
224
|
+
var $this = $(this)
|
225
|
+
var href = $this.attr('href')
|
226
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
227
|
+
var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
237
228
|
|
238
229
|
e.preventDefault()
|
239
230
|
|
@@ -242,6 +233,10 @@
|
|
242
233
|
.one('hide', function () {
|
243
234
|
$this.focus()
|
244
235
|
})
|
245
|
-
|
236
|
+
})
|
237
|
+
|
238
|
+
var $body = $(document.body)
|
239
|
+
.on('bs.modal.shown', '.modal', function () { $body.addClass('modal-open') })
|
240
|
+
.on('bs.modal.hidden', '.modal', function () { $body.removeClass('modal-open') })
|
246
241
|
|
247
242
|
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: popover.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
4
|
-
*
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,96 +15,91 @@
|
|
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
|
+
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
31
|
+
placement: 'right'
|
32
|
+
, trigger: 'click'
|
33
|
+
, content: ''
|
34
|
+
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
35
|
+
})
|
33
36
|
|
34
|
-
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
35
|
-
========================================== */
|
36
37
|
|
37
|
-
|
38
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
39
|
+
// ================================
|
38
40
|
|
39
|
-
|
41
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
40
42
|
|
41
|
-
|
42
|
-
var $tip = this.tip()
|
43
|
-
, title = this.getTitle()
|
44
|
-
, content = this.getContent()
|
43
|
+
Popover.prototype.constructor = Popover
|
45
44
|
|
46
|
-
|
47
|
-
|
45
|
+
Popover.prototype.getDefaults = function () {
|
46
|
+
return Popover.DEFAULTS
|
47
|
+
}
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
Popover.prototype.setContent = function () {
|
50
|
+
var $tip = this.tip()
|
51
|
+
var title = this.getTitle()
|
52
|
+
var content = this.getContent()
|
51
53
|
|
52
|
-
|
53
|
-
|
54
|
-
}
|
54
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
55
|
+
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
, $e = this.$element
|
59
|
-
, o = this.options
|
57
|
+
$tip.removeClass('fade top bottom left right in')
|
58
|
+
}
|
60
59
|
|
61
|
-
|
62
|
-
|
60
|
+
Popover.prototype.hasContent = function () {
|
61
|
+
return this.getTitle() || this.getContent()
|
62
|
+
}
|
63
63
|
|
64
|
-
|
65
|
-
|
64
|
+
Popover.prototype.getContent = function () {
|
65
|
+
var content = typeof this.options.content == 'function' ?
|
66
|
+
this.options.content.call(this.$element[0]) :
|
67
|
+
this.options.content
|
66
68
|
|
67
|
-
|
68
|
-
|
69
|
-
this.$tip = $(this.options.template)
|
70
|
-
}
|
71
|
-
return this.$tip
|
72
|
-
}
|
69
|
+
return content || this.$element.attr('data-content')
|
70
|
+
}
|
73
71
|
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
Popover.prototype.tip = function () {
|
73
|
+
if (!this.$tip) this.$tip = $(this.options.template)
|
74
|
+
return this.$tip
|
75
|
+
}
|
77
76
|
|
78
|
-
|
77
|
+
Popover.prototype.destroy = function () {
|
78
|
+
this.hide().$element.off('.' + this.type).removeData(this.type)
|
79
|
+
}
|
79
80
|
|
80
81
|
|
81
|
-
|
82
|
-
|
82
|
+
// POPOVER PLUGIN DEFINITION
|
83
|
+
// =========================
|
83
84
|
|
84
85
|
var old = $.fn.popover
|
85
86
|
|
86
87
|
$.fn.popover = function (option) {
|
87
88
|
return this.each(function () {
|
88
|
-
var $this
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
var $this = $(this)
|
90
|
+
var data = $this.data('bs.popover')
|
91
|
+
var options = typeof option == 'object' && option
|
92
|
+
|
93
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
92
94
|
if (typeof option == 'string') data[option]()
|
93
95
|
})
|
94
96
|
}
|
95
97
|
|
96
98
|
$.fn.popover.Constructor = Popover
|
97
99
|
|
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
100
|
|
106
|
-
|
107
|
-
|
101
|
+
// POPOVER NO CONFLICT
|
102
|
+
// ===================
|
108
103
|
|
109
104
|
$.fn.popover.noConflict = function () {
|
110
105
|
$.fn.popover = old
|