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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/Rakefile +42 -26
  4. data/lib/bootstrap-rails.rb +5 -6
  5. data/lib/bootstrap-rails/engine.rb +2 -9
  6. data/lib/bootstrap-rails/version.rb +1 -1
  7. data/test/test_helper.rb +2 -2
  8. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
  9. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
  10. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +175 -0
  11. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
  12. data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
  13. data/vendor/assets/javascripts/twitter/bootstrap.js +4 -5
  14. data/vendor/assets/javascripts/twitter/bootstrap/affix.js +50 -47
  15. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +32 -35
  16. data/vendor/assets/javascripts/twitter/bootstrap/button.js +37 -37
  17. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +123 -127
  18. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +81 -95
  19. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +61 -81
  20. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +146 -151
  21. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +53 -58
  22. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +99 -105
  23. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +70 -81
  24. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +246 -254
  25. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +24 -37
  26. data/vendor/assets/stylesheets/twitter/bootstrap.scss +1 -1
  27. data/vendor/{frameworks/twitter/bootstrap/accordion.scss → assets/stylesheets/twitter/bootstrap/_accordion.scss} +2 -2
  28. data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +92 -0
  29. data/vendor/assets/stylesheets/twitter/bootstrap/_badges.scss +58 -0
  30. data/vendor/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +64 -0
  31. data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +28 -0
  32. data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +170 -0
  33. data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +160 -0
  34. data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +191 -0
  35. data/vendor/{frameworks/twitter/bootstrap/close.scss → assets/stylesheets/twitter/bootstrap/_close.scss} +7 -6
  36. data/vendor/{frameworks/twitter/bootstrap/code.scss → assets/stylesheets/twitter/bootstrap/_code.scss} +14 -14
  37. data/vendor/{frameworks/twitter/bootstrap/component-animations.scss → assets/stylesheets/twitter/bootstrap/_component-animations.scss} +1 -0
  38. data/vendor/{frameworks/twitter/bootstrap/dropdowns.scss → assets/stylesheets/twitter/bootstrap/_dropdowns.scss} +46 -57
  39. data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +464 -0
  40. data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +200 -0
  41. data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +65 -0
  42. data/vendor/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +32 -0
  43. data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +70 -0
  44. data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +96 -0
  45. data/vendor/{frameworks/twitter/bootstrap/media.scss → assets/stylesheets/twitter/bootstrap/_media.scss} +0 -1
  46. data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +510 -0
  47. data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +137 -0
  48. data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +356 -0
  49. data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +249 -0
  50. data/vendor/assets/stylesheets/twitter/bootstrap/_normalize.scss +396 -0
  51. data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +54 -0
  52. data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +87 -0
  53. data/vendor/assets/stylesheets/twitter/bootstrap/_panels.scss +96 -0
  54. data/vendor/{frameworks/twitter/bootstrap/popovers.scss → assets/stylesheets/twitter/bootstrap/_popovers.scss} +32 -32
  55. data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +74 -0
  56. data/vendor/{frameworks/twitter/bootstrap/progress-bars.scss → assets/stylesheets/twitter/bootstrap/_progress-bars.scss} +40 -44
  57. data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +77 -0
  58. data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +83 -0
  59. data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +242 -0
  60. data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +43 -0
  61. data/vendor/{frameworks/twitter/bootstrap/tooltip.scss → assets/stylesheets/twitter/bootstrap/_tooltip.scss} +20 -19
  62. data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +253 -0
  63. data/vendor/{frameworks/twitter/bootstrap/utilities.scss → assets/stylesheets/twitter/bootstrap/_utilities.scss} +17 -5
  64. data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +416 -0
  65. data/vendor/{frameworks/twitter/bootstrap/wells.scss → assets/stylesheets/twitter/bootstrap/_wells.scss} +5 -5
  66. metadata +49 -53
  67. data/lib/bootstrap-rails/ie_hex_str.rb +0 -16
  68. data/test/ie_hex_str_test.rb +0 -26
  69. data/vendor/assets/images/twitter/glyphicons-halflings-white.png +0 -0
  70. data/vendor/assets/images/twitter/glyphicons-halflings.png +0 -0
  71. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
  72. data/vendor/assets/stylesheets/twitter/bootstrap-responsive.scss +0 -1
  73. data/vendor/frameworks/twitter/bootstrap.scss +0 -1
  74. data/vendor/frameworks/twitter/bootstrap/alerts.scss +0 -79
  75. data/vendor/frameworks/twitter/bootstrap/bootstrap.scss +0 -63
  76. data/vendor/frameworks/twitter/bootstrap/breadcrumbs.scss +0 -24
  77. data/vendor/frameworks/twitter/bootstrap/button-groups.scss +0 -230
  78. data/vendor/frameworks/twitter/bootstrap/buttons.scss +0 -228
  79. data/vendor/frameworks/twitter/bootstrap/carousel.scss +0 -158
  80. data/vendor/frameworks/twitter/bootstrap/forms.scss +0 -690
  81. data/vendor/frameworks/twitter/bootstrap/grid.scss +0 -21
  82. data/vendor/frameworks/twitter/bootstrap/hero-unit.scss +0 -25
  83. data/vendor/frameworks/twitter/bootstrap/labels-badges.scss +0 -83
  84. data/vendor/frameworks/twitter/bootstrap/layouts.scss +0 -16
  85. data/vendor/frameworks/twitter/bootstrap/mixins.scss +0 -704
  86. data/vendor/frameworks/twitter/bootstrap/modals.scss +0 -95
  87. data/vendor/frameworks/twitter/bootstrap/navbar.scss +0 -496
  88. data/vendor/frameworks/twitter/bootstrap/navs.scss +0 -409
  89. data/vendor/frameworks/twitter/bootstrap/pager.scss +0 -43
  90. data/vendor/frameworks/twitter/bootstrap/pagination.scss +0 -123
  91. data/vendor/frameworks/twitter/bootstrap/reset.scss +0 -216
  92. data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.scss +0 -28
  93. data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.scss +0 -189
  94. data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.scss +0 -19
  95. data/vendor/frameworks/twitter/bootstrap/responsive-navbar.scss +0 -189
  96. data/vendor/frameworks/twitter/bootstrap/responsive-utilities.scss +0 -59
  97. data/vendor/frameworks/twitter/bootstrap/responsive.scss +0 -48
  98. data/vendor/frameworks/twitter/bootstrap/scaffolding.scss +0 -53
  99. data/vendor/frameworks/twitter/bootstrap/sprites.scss +0 -197
  100. data/vendor/frameworks/twitter/bootstrap/tables.scss +0 -235
  101. data/vendor/frameworks/twitter/bootstrap/thumbnails.scss +0 -53
  102. data/vendor/frameworks/twitter/bootstrap/type.scss +0 -246
  103. data/vendor/frameworks/twitter/bootstrap/variables.scss +0 -295
@@ -1,8 +1,8 @@
1
- /* ===========================================================
2
- * bootstrap-tooltip.js v2.3.1
3
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
1
+ /* ========================================================================
2
+ * Bootstrap: tooltip.js v3.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#affix
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
- * ===========================================================
5
+ * ========================================================================
6
6
  * Copyright 2012 Twitter, Inc.
7
7
  *
8
8
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,342 +16,334 @@
16
16
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
17
  * See the License for the specific language governing permissions and
18
18
  * limitations under the License.
19
- * ========================================================== */
19
+ * ======================================================================== */
20
20
 
21
21
 
22
- !function ($) {
22
+ +function ($) { "use strict";
23
23
 
24
- "use strict"; // jshint ;_;
25
-
26
-
27
- /* TOOLTIP PUBLIC CLASS DEFINITION
28
- * =============================== */
24
+ // TOOLTIP PUBLIC CLASS DEFINITION
25
+ // ===============================
29
26
 
30
27
  var Tooltip = function (element, options) {
28
+ this.type =
29
+ this.options =
30
+ this.enabled =
31
+ this.timeout =
32
+ this.hoverState =
33
+ this.$element = null
34
+
31
35
  this.init('tooltip', element, options)
32
36
  }
33
37
 
34
- Tooltip.prototype = {
35
-
36
- constructor: Tooltip
37
-
38
- , init: function (type, element, options) {
39
- var eventIn
40
- , eventOut
41
- , triggers
42
- , trigger
43
- , i
44
-
45
- this.type = type
46
- this.$element = $(element)
47
- this.options = this.getOptions(options)
48
- this.enabled = true
49
-
50
- triggers = this.options.trigger.split(' ')
51
-
52
- for (i = triggers.length; i--;) {
53
- trigger = triggers[i]
54
- if (trigger == 'click') {
55
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
56
- } else if (trigger != 'manual') {
57
- eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
58
- eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
59
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
60
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
61
- }
62
- }
38
+ Tooltip.DEFAULTS = {
39
+ animation: true
40
+ , placement: 'top'
41
+ , selector: false
42
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
43
+ , trigger: 'hover focus'
44
+ , title: ''
45
+ , delay: 0
46
+ , html: false
47
+ , container: false
48
+ }
63
49
 
64
- this.options.selector ?
65
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
66
- this.fixTitle()
67
- }
50
+ Tooltip.prototype.init = function (type, element, options) {
51
+ this.enabled = true
52
+ this.type = type
53
+ this.$element = $(element)
54
+ this.options = this.getOptions(options)
68
55
 
69
- , getOptions: function (options) {
70
- options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
56
+ var triggers = this.options.trigger.split(' ')
71
57
 
72
- if (options.delay && typeof options.delay == 'number') {
73
- options.delay = {
74
- show: options.delay
75
- , hide: options.delay
76
- }
58
+ for (var i = triggers.length; i--;) {
59
+ var trigger = triggers[i]
60
+
61
+ if (trigger == 'click') {
62
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
63
+ } else if (trigger != 'manual') {
64
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
65
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
66
+
67
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
68
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
77
69
  }
70
+ }
78
71
 
79
- return options
72
+ this.options.selector ?
73
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
74
+ this.fixTitle()
75
+ }
76
+
77
+ Tooltip.prototype.getDefaults = function () {
78
+ return Tooltip.DEFAULTS
79
+ }
80
+
81
+ Tooltip.prototype.getOptions = function (options) {
82
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
83
+
84
+ if (options.delay && typeof options.delay == 'number') {
85
+ options.delay = {
86
+ show: options.delay
87
+ , hide: options.delay
88
+ }
80
89
  }
81
90
 
82
- , enter: function (e) {
83
- var defaults = $.fn[this.type].defaults
84
- , options = {}
85
- , self
91
+ return options
92
+ }
86
93
 
87
- this._options && $.each(this._options, function (key, value) {
88
- if (defaults[key] != value) options[key] = value
89
- }, this)
94
+ Tooltip.prototype.enter = function (e) {
95
+ var defaults = this.getDefaults()
96
+ var options = {}
90
97
 
91
- self = $(e.currentTarget)[this.type](options).data(this.type)
98
+ this._options && $.each(this._options, function (key, value) {
99
+ if (defaults[key] != value) options[key] = value
100
+ })
92
101
 
93
- if (!self.options.delay || !self.options.delay.show) return self.show()
102
+ var self = $(e.currentTarget)[this.type](options).data('bs.' + this.type)
94
103
 
95
- clearTimeout(this.timeout)
96
- self.hoverState = 'in'
97
- this.timeout = setTimeout(function() {
98
- if (self.hoverState == 'in') self.show()
99
- }, self.options.delay.show)
100
- }
104
+ if (!self.options.delay || !self.options.delay.show) return self.show()
101
105
 
102
- , leave: function (e) {
103
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
106
+ clearTimeout(this.timeout)
104
107
 
105
- if (this.timeout) clearTimeout(this.timeout)
106
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
108
+ self.hoverState = 'in'
109
+ this.timeout = setTimeout(function() {
110
+ if (self.hoverState == 'in') self.show()
111
+ }, self.options.delay.show)
112
+ }
107
113
 
108
- self.hoverState = 'out'
109
- this.timeout = setTimeout(function() {
110
- if (self.hoverState == 'out') self.hide()
111
- }, self.options.delay.hide)
112
- }
114
+ Tooltip.prototype.leave = function (e) {
115
+ var self = $(e.currentTarget)[this.type](this._options).data('bs.' + this.type)
116
+
117
+ if (this.timeout) clearTimeout(this.timeout)
118
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
113
119
 
114
- , show: function () {
115
- var $tip
116
- , pos
117
- , actualWidth
118
- , actualHeight
119
- , placement
120
- , tp
121
- , e = $.Event('show')
120
+ self.hoverState = 'out'
121
+ this.timeout = setTimeout(function() {
122
+ if (self.hoverState == 'out') self.hide()
123
+ }, self.options.delay.hide)
124
+ }
122
125
 
123
- if (this.hasContent() && this.enabled) {
124
- this.$element.trigger(e)
125
- if (e.isDefaultPrevented()) return
126
- $tip = this.tip()
127
- this.setContent()
126
+ Tooltip.prototype.show = function () {
127
+ var e = $.Event('show.bs.'+ this.type)
128
128
 
129
- if (this.options.animation) {
130
- $tip.addClass('fade')
131
- }
129
+ if (this.hasContent() && this.enabled) {
130
+ this.$element.trigger(e)
132
131
 
133
- placement = typeof this.options.placement == 'function' ?
134
- this.options.placement.call(this, $tip[0], this.$element[0]) :
135
- this.options.placement
132
+ if (e.isDefaultPrevented()) return
136
133
 
137
- $tip
138
- .detach()
139
- .css({ top: 0, left: 0, display: 'block' })
134
+ var $tip = this.tip()
140
135
 
141
- this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
136
+ this.setContent()
142
137
 
143
- pos = this.getPosition()
138
+ if (this.options.animation) $tip.addClass('fade')
144
139
 
145
- actualWidth = $tip[0].offsetWidth
146
- actualHeight = $tip[0].offsetHeight
140
+ var placement = typeof this.options.placement == 'function' ?
141
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
142
+ this.options.placement
147
143
 
148
- switch (placement) {
149
- case 'bottom':
150
- tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
151
- break
152
- case 'top':
153
- tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
154
- break
155
- case 'left':
156
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
157
- break
158
- case 'right':
159
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
160
- break
161
- }
162
-
163
- this.applyPlacement(tp, placement)
164
- this.$element.trigger('shown')
144
+ $tip
145
+ .detach()
146
+ .css({ top: 0, left: 0, display: 'block' })
147
+
148
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
149
+
150
+ var tp
151
+ var pos = this.getPosition()
152
+ var actualWidth = $tip[0].offsetWidth
153
+ var actualHeight = $tip[0].offsetHeight
154
+
155
+ switch (placement) {
156
+ case 'bottom':
157
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
158
+ break
159
+ case 'top':
160
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
161
+ break
162
+ case 'left':
163
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
164
+ break
165
+ case 'right':
166
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
167
+ break
165
168
  }
169
+
170
+ this.applyPlacement(tp, placement)
171
+ this.$element.trigger('shown.bs.' + this.type)
166
172
  }
173
+ }
167
174
 
168
- , applyPlacement: function(offset, placement){
169
- var $tip = this.tip()
170
- , width = $tip[0].offsetWidth
171
- , height = $tip[0].offsetHeight
172
- , actualWidth
173
- , actualHeight
174
- , delta
175
- , replace
175
+ Tooltip.prototype.applyPlacement = function(offset, placement) {
176
+ var replace
177
+ var $tip = this.tip()
178
+ var width = $tip[0].offsetWidth
179
+ var height = $tip[0].offsetHeight
176
180
 
177
- $tip
178
- .offset(offset)
179
- .addClass(placement)
180
- .addClass('in')
181
+ $tip
182
+ .offset(offset)
183
+ .addClass(placement)
184
+ .addClass('in')
181
185
 
182
- actualWidth = $tip[0].offsetWidth
183
- actualHeight = $tip[0].offsetHeight
186
+ var actualWidth = $tip[0].offsetWidth
187
+ var actualHeight = $tip[0].offsetHeight
184
188
 
185
- if (placement == 'top' && actualHeight != height) {
186
- offset.top = offset.top + height - actualHeight
187
- replace = true
188
- }
189
+ if (placement == 'top' && actualHeight != height) {
190
+ replace = true
191
+ offset.top = offset.top + height - actualHeight
192
+ }
189
193
 
190
- if (placement == 'bottom' || placement == 'top') {
191
- delta = 0
194
+ if (placement == 'bottom' || placement == 'top') {
195
+ var delta = 0
192
196
 
193
- if (offset.left < 0){
194
- delta = offset.left * -2
195
- offset.left = 0
196
- $tip.offset(offset)
197
- actualWidth = $tip[0].offsetWidth
198
- actualHeight = $tip[0].offsetHeight
199
- }
197
+ if (offset.left < 0){
198
+ delta = offset.left * -2
199
+ offset.left = 0
200
200
 
201
- this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
202
- } else {
203
- this.replaceArrow(actualHeight - height, actualHeight, 'top')
201
+ $tip.offset(offset)
202
+
203
+ actualWidth = $tip[0].offsetWidth
204
+ actualHeight = $tip[0].offsetHeight
204
205
  }
205
206
 
206
- if (replace) $tip.offset(offset)
207
+ this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
208
+ } else {
209
+ this.replaceArrow(actualHeight - height, actualHeight, 'top')
207
210
  }
208
211
 
209
- , replaceArrow: function(delta, dimension, position){
210
- this
211
- .arrow()
212
- .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
213
- }
212
+ if (replace) $tip.offset(offset)
213
+ }
214
214
 
215
- , setContent: function () {
216
- var $tip = this.tip()
217
- , title = this.getTitle()
215
+ Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
216
+ this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
217
+ }
218
218
 
219
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
220
- $tip.removeClass('fade in top bottom left right')
221
- }
219
+ Tooltip.prototype.setContent = function () {
220
+ var $tip = this.tip()
221
+ var title = this.getTitle()
222
222
 
223
- , hide: function () {
224
- var that = this
225
- , $tip = this.tip()
226
- , e = $.Event('hide')
223
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
224
+ $tip.removeClass('fade in top bottom left right')
225
+ }
227
226
 
228
- this.$element.trigger(e)
229
- if (e.isDefaultPrevented()) return
227
+ Tooltip.prototype.hide = function () {
228
+ var that = this
229
+ var $tip = this.tip()
230
+ var e = $.Event('hide.bs.' + this.type)
230
231
 
231
- $tip.removeClass('in')
232
+ this.$element.trigger(e)
232
233
 
233
- function removeWithAnimation() {
234
- var timeout = setTimeout(function () {
235
- $tip.off($.support.transition.end).detach()
236
- }, 500)
234
+ if (e.isDefaultPrevented()) return
237
235
 
238
- $tip.one($.support.transition.end, function () {
239
- clearTimeout(timeout)
240
- $tip.detach()
241
- })
242
- }
236
+ $tip.removeClass('in')
243
237
 
244
- $.support.transition && this.$tip.hasClass('fade') ?
245
- removeWithAnimation() :
238
+ function removeWithAnimation() {
239
+ var timeout = setTimeout(function () {
240
+ $tip.off($.support.transition.end).detach()
241
+ }, 500)
242
+
243
+ $tip.one($.support.transition.end, function () {
244
+ clearTimeout(timeout)
246
245
  $tip.detach()
246
+ })
247
+ }
247
248
 
248
- this.$element.trigger('hidden')
249
+ $.support.transition && this.$tip.hasClass('fade') ?
250
+ removeWithAnimation() :
251
+ $tip.detach()
249
252
 
250
- return this
251
- }
253
+ this.$element.trigger('hidden.bs.' + this.type)
252
254
 
253
- , fixTitle: function () {
254
- var $e = this.$element
255
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
256
- $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
257
- }
258
- }
255
+ return this
256
+ }
259
257
 
260
- , hasContent: function () {
261
- return this.getTitle()
258
+ Tooltip.prototype.fixTitle = function () {
259
+ var $e = this.$element
260
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
261
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
262
262
  }
263
+ }
263
264
 
264
- , getPosition: function () {
265
- var el = this.$element[0]
266
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
267
- width: el.offsetWidth
268
- , height: el.offsetHeight
269
- }, this.$element.offset())
270
- }
265
+ Tooltip.prototype.hasContent = function () {
266
+ return this.getTitle()
267
+ }
271
268
 
272
- , getTitle: function () {
273
- var title
274
- , $e = this.$element
275
- , o = this.options
269
+ Tooltip.prototype.getPosition = function () {
270
+ var el = this.$element[0]
271
+ return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
272
+ width: el.offsetWidth
273
+ , height: el.offsetHeight
274
+ }, this.$element.offset())
275
+ }
276
276
 
277
- title = $e.attr('data-original-title')
278
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
277
+ Tooltip.prototype.getTitle = function () {
278
+ var title
279
+ var $e = this.$element
280
+ var o = this.options
279
281
 
280
- return title
281
- }
282
+ title = $e.attr('data-original-title')
283
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
282
284
 
283
- , tip: function () {
284
- return this.$tip = this.$tip || $(this.options.template)
285
- }
285
+ return title
286
+ }
286
287
 
287
- , arrow: function(){
288
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
289
- }
288
+ Tooltip.prototype.tip = function () {
289
+ return this.$tip = this.$tip || $(this.options.template)
290
+ }
290
291
 
291
- , validate: function () {
292
- if (!this.$element[0].parentNode) {
293
- this.hide()
294
- this.$element = null
295
- this.options = null
296
- }
297
- }
292
+ Tooltip.prototype.arrow =function(){
293
+ return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
294
+ }
298
295
 
299
- , enable: function () {
300
- this.enabled = true
296
+ Tooltip.prototype.validate = function () {
297
+ if (!this.$element[0].parentNode) {
298
+ this.hide()
299
+ this.$element = null
300
+ this.options = null
301
301
  }
302
+ }
302
303
 
303
- , disable: function () {
304
- this.enabled = false
305
- }
304
+ Tooltip.prototype.enable = function () {
305
+ this.enabled = true
306
+ }
306
307
 
307
- , toggleEnabled: function () {
308
- this.enabled = !this.enabled
309
- }
308
+ Tooltip.prototype.disable = function () {
309
+ this.enabled = false
310
+ }
310
311
 
311
- , toggle: function (e) {
312
- var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
313
- self.tip().hasClass('in') ? self.hide() : self.show()
314
- }
312
+ Tooltip.prototype.toggleEnabled = function () {
313
+ this.enabled = !this.enabled
314
+ }
315
315
 
316
- , destroy: function () {
317
- this.hide().$element.off('.' + this.type).removeData(this.type)
318
- }
316
+ Tooltip.prototype.toggle = function (e) {
317
+ var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
318
+ self.tip().hasClass('in') ? self.hide() : self.show()
319
+ }
319
320
 
321
+ Tooltip.prototype.destroy = function () {
322
+ this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
320
323
  }
321
324
 
322
325
 
323
- /* TOOLTIP PLUGIN DEFINITION
324
- * ========================= */
326
+ // TOOLTIP PLUGIN DEFINITION
327
+ // =========================
325
328
 
326
329
  var old = $.fn.tooltip
327
330
 
328
- $.fn.tooltip = function ( option ) {
331
+ $.fn.tooltip = function (option) {
329
332
  return this.each(function () {
330
- var $this = $(this)
331
- , data = $this.data('tooltip')
332
- , options = typeof option == 'object' && option
333
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
333
+ var $this = $(this)
334
+ var data = $this.data('bs.tooltip')
335
+ var options = typeof option == 'object' && option
336
+
337
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
334
338
  if (typeof option == 'string') data[option]()
335
339
  })
336
340
  }
337
341
 
338
342
  $.fn.tooltip.Constructor = Tooltip
339
343
 
340
- $.fn.tooltip.defaults = {
341
- animation: true
342
- , placement: 'top'
343
- , selector: false
344
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
345
- , trigger: 'hover focus'
346
- , title: ''
347
- , delay: 0
348
- , html: false
349
- , container: false
350
- }
351
-
352
344
 
353
- /* TOOLTIP NO CONFLICT
354
- * =================== */
345
+ // TOOLTIP NO CONFLICT
346
+ // ===================
355
347
 
356
348
  $.fn.tooltip.noConflict = function () {
357
349
  $.fn.tooltip = old