"+match+""})},render:function(items){var that=this;return items=$(items).map(function(i,item){return i=$(that.options.item).attr("data-value",item),i.find("a").html(that.highlighter(item)),i[0]}),items.first().addClass("active"),this.$menu.html(items),this},next:function(){var active=this.$menu.find(".active").removeClass("active"),next=active.next();next.length||(next=$(this.$menu.find("li")[0])),next.addClass("active")},prev:function(){var active=this.$menu.find(".active").removeClass("active"),prev=active.prev();prev.length||(prev=this.$menu.find("li").last()),prev.addClass("active")},listen:function(){this.$element.on("blur",$.proxy(this.blur,this)).on("keypress",$.proxy(this.keypress,this)).on("keyup",$.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",$.proxy(this.keydown,this)),this.$menu.on("click",$.proxy(this.click,this)).on("mouseenter","li",$.proxy(this.mouseenter,this))},eventSupported:function(eventName){var isSupported=eventName in this.$element;return isSupported||(this.$element.setAttribute(eventName,"return;"),isSupported="function"==typeof this.$element[eventName]),isSupported},move:function(e){if(this.shown){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()}},keydown:function(e){this.suppressKeyPressRepeat=~$.inArray(e.keyCode,[40,38,9,13,27]),this.move(e)},keypress:function(e){this.suppressKeyPressRepeat||this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(){var that=this;setTimeout(function(){that.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(e){this.$menu.find(".active").removeClass("active"),$(e.currentTarget).addClass("active")}};var old=$.fn.typeahead;$.fn.typeahead=function(option){return this.each(function(){var $this=$(this),data=$this.data("typeahead"),options="object"==typeof option&&option;data||$this.data("typeahead",data=new Typeahead(this,options)),"string"==typeof option&&data[option]()})},$.fn.typeahead.defaults={source:[],items:8,menu:'',item:' ',minLength:1},$.fn.typeahead.Constructor=Typeahead,$.fn.typeahead.noConflict=function(){return $.fn.typeahead=old,this},$(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var $this=$(this);$this.data("typeahead")||(e.preventDefault(),$this.typeahead($this.data()))})}(window.jQuery),!function($){"use strict";var Affix=function(element,options){this.options=$.extend({},$.fn.affix.defaults,options),this.$window=$(window).on("scroll.affix.data-api",$.proxy(this.checkPosition,this)).on("click.affix.data-api",$.proxy(function(){setTimeout($.proxy(this.checkPosition,this),1)},this)),this.$element=$(element),this.checkPosition()};Affix.prototype.checkPosition=function(){if(this.$element.is(":visible")){var affix,scrollHeight=$(document).height(),scrollTop=this.$window.scrollTop(),position=this.$element.offset(),offset=this.options.offset,offsetBottom=offset.bottom,offsetTop=offset.top,reset="affix affix-top affix-bottom";"object"!=typeof offset&&(offsetBottom=offsetTop=offset),"function"==typeof offsetTop&&(offsetTop=offset.top()),"function"==typeof offsetBottom&&(offsetBottom=offset.bottom()),affix=null!=this.unpin&&scrollTop+this.unpin<=position.top?!1:null!=offsetBottom&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":null!=offsetTop&&offsetTop>=scrollTop?"top":!1,this.affixed!==affix&&(this.affixed=affix,this.unpin="bottom"==affix?position.top-scrollTop:null,this.$element.removeClass(reset).addClass("affix"+(affix?"-"+affix:"")))}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this),data=$this.data("affix"),options="object"==typeof option&&option;data||$this.data("affix",data=new Affix(this,options)),"string"==typeof option&&data[option]()})},$.fn.affix.Constructor=Affix,$.fn.affix.defaults={offset:0},$.fn.affix.noConflict=function(){return $.fn.affix=old,this},$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this),data=$spy.data();data.offset=data.offset||{},data.offsetBottom&&(data.offset.bottom=data.offsetBottom),data.offsetTop&&(data.offset.top=data.offsetTop),$spy.affix(data)})})}(window.jQuery);
\ No newline at end of file
diff --git a/docs/components.html b/docs/components.html
index c6d430e90..990f31ae6 100644
--- a/docs/components.html
+++ b/docs/components.html
@@ -1823,16 +1823,16 @@
<div class="alert">
- <button type="button" class="close" data-dismiss="alert">×</button>
+ <button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
Dismiss buttons
Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.
- <a href="#" class="close" data-dismiss="alert">×</a>
+ <a href="#" class="close" data-dismiss="alert">×</a>
Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.
- <button type="button" class="close" data-dismiss="alert">×</button>
+ <button type="button" class="close" data-dismiss="alert">×</button>
Dismiss alerts via JavaScript
Use the alerts jQuery plugin for quick and easy dismissal of alerts.
@@ -1852,7 +1852,7 @@
<div class="alert alert-block">
- <button type="button" class="close" data-dismiss="alert">×</button>
+ <button type="button" class="close" data-dismiss="alert">×</button>
<h4>Warning!</h4>
Best check yo self, you're not...
</div>
diff --git a/docs/javascript.html b/docs/javascript.html
index ec97c87ec..6c4fbf7fb 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -131,9 +131,17 @@ $("#myModal").modal('show') // initializes and invokes show immed
Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').
+ No conflict
+ Sometimes it's neccessary to use bootstrap plugins with other ui frameworks. In these circumstances, occasionally namespace collisions can occur. If this happens, you may call .noCoflict on the plugin you wish to revert the value of.
+
+
+var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
+$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality
+
+
Events
Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.
- All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.
+ All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.
$('#myModal').on('show', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown
@@ -1122,7 +1130,7 @@ $('#my-alert').bind('closed', function () {
Do more with buttons. Control button states or create groups of buttons for more components like toolbars.
Stateful
- Add data-loading-text="Loading..." to use a loading state on a button.
+ Add data-loading-text="Loading..." to use a loading state on a button.
Loading state
@@ -1131,14 +1139,14 @@ $('#my-alert').bind('closed', function () {
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
Single toggle
- Add data-toggle="button" to activate toggling on a single button.
+ Add data-toggle="button" to activate toggling on a single button.
Single Toggle
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
Checkbox
- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.
+ Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.
Left
@@ -1155,7 +1163,7 @@ $('#my-alert').bind('closed', function () {
Radio
-
Add data-toggle="buttons-radio" for radio style toggling on btn-group.
+
Add data-toggle="buttons-radio" for radio style toggling on btn-group.
Left
diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache
index 939babe0f..ad37836b0 100644
--- a/docs/templates/pages/components.mustache
+++ b/docs/templates/pages/components.mustache
@@ -1755,16 +1755,16 @@
<div class="alert">
- <button type="button" class="close" data-dismiss="alert">×</button>
+ <button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
Dismiss buttons
Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.
-
<a href="#" class="close" data-dismiss="alert">×</a>
+
<a href="#" class="close" data-dismiss="alert">×</a>
Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.
-
<button type="button" class="close" data-dismiss="alert">×</button>
+
<button type="button" class="close" data-dismiss="alert">×</button>
Dismiss alerts via JavaScript
Use the alerts jQuery plugin for quick and easy dismissal of alerts.
@@ -1784,7 +1784,7 @@
<div class="alert alert-block">
- <button type="button" class="close" data-dismiss="alert">×</button>
+ <button type="button" class="close" data-dismiss="alert">×</button>
<h4>Warning!</h4>
Best check yo self, you're not...
</div>
diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache
index c58ab0835..5ff9fcb82 100644
--- a/docs/templates/pages/javascript.mustache
+++ b/docs/templates/pages/javascript.mustache
@@ -63,9 +63,17 @@ $("#myModal").modal('show') // initializes and invokes show immed
Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').
+
No conflict
+
Sometimes it's neccessary to use bootstrap plugins with other ui frameworks. In these circumstances, occasionally namespace collisions can occur. If this happens, you may call .noCoflict on the plugin you wish to revert the value of.
+
+
+var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
+$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality
+
+
Events
Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.
-
All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.
+
All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.
$('#myModal').on('show', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown
@@ -1055,7 +1063,7 @@ $('#my-alert').bind('closed', function () {
Do more with buttons. Control button states or create groups of buttons for more components like toolbars.
Stateful
- Add data-loading-text="Loading..." to use a loading state on a button.
+ Add data-loading-text="Loading..." to use a loading state on a button.
Loading state
@@ -1064,14 +1072,14 @@ $('#my-alert').bind('closed', function () {
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
Single toggle
- Add data-toggle="button" to activate toggling on a single button.
+ Add data-toggle="button" to activate toggling on a single button.
Single Toggle
{{! /example }}
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
Checkbox
- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.
+ Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.
Left
@@ -1088,7 +1096,7 @@ $('#my-alert').bind('closed', function () {
Radio
-
Add data-toggle="buttons-radio" for radio style toggling on btn-group.
+
Add data-toggle="buttons-radio" for radio style toggling on btn-group.
Left
diff --git a/js/bootstrap-affix.js b/js/bootstrap-affix.js
index 0de787e8c..2b76881c5 100644
--- a/js/bootstrap-affix.js
+++ b/js/bootstrap-affix.js
@@ -68,6 +68,8 @@
/* AFFIX PLUGIN DEFINITION
* ======================= */
+ var old = $.fn.affix
+
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
@@ -85,6 +87,15 @@
}
+ /* AFFIX NO CONFLICT
+ * ================= */
+
+ $.fn.affix.noConflict = function () {
+ $.fn.affix = old
+ return this
+ }
+
+
/* AFFIX DATA-API
* ============== */
diff --git a/js/bootstrap-alert.js b/js/bootstrap-alert.js
index c95718977..bc4567453 100644
--- a/js/bootstrap-alert.js
+++ b/js/bootstrap-alert.js
@@ -68,6 +68,8 @@
/* ALERT PLUGIN DEFINITION
* ======================= */
+ var old = $.fn.alert
+
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
@@ -80,6 +82,15 @@
$.fn.alert.Constructor = Alert
+ /* ALERT NO CONFLICT
+ * ================= */
+
+ $.fn.alert.noConflict = function () {
+ $.fn.alert = old
+ return this
+ }
+
+
/* ALERT DATA-API
* ============== */
diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js
index f2e3b7729..6e1aa9c81 100644
--- a/js/bootstrap-button.js
+++ b/js/bootstrap-button.js
@@ -64,6 +64,8 @@
/* BUTTON PLUGIN DEFINITION
* ======================== */
+ var old = $.fn.button
+
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
@@ -82,6 +84,15 @@
$.fn.button.Constructor = Button
+ /* BUTTON NO CONFLICT
+ * ================== */
+
+ $.fn.button.noConflict = function () {
+ $.fn.button = old
+ return this
+ }
+
+
/* BUTTON DATA-API
* =============== */
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js
index 875aaca56..53afac633 100644
--- a/js/bootstrap-carousel.js
+++ b/js/bootstrap-carousel.js
@@ -29,7 +29,6 @@
var Carousel = function (element, options) {
this.$element = $(element)
this.options = options
- this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
@@ -141,6 +140,8 @@
/* CAROUSEL PLUGIN DEFINITION
* ========================== */
+ var old = $.fn.carousel
+
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
@@ -162,6 +163,14 @@
$.fn.carousel.Constructor = Carousel
+ /* CAROUSEL NO CONFLICT
+ * ==================== */
+
+ $.fn.carousel.noConflict = function () {
+ $.fn.carousel = old
+ return this
+ }
+
/* CAROUSEL DATA-API
* ================= */
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index d792d850f..5efdcb1f6 100644
--- a/js/bootstrap-collapse.js
+++ b/js/bootstrap-collapse.js
@@ -120,8 +120,10 @@
}
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
+ /* COLLAPSE PLUGIN DEFINITION
+ * ========================== */
+
+ var old = $.fn.collapse
$.fn.collapse = function (option) {
return this.each(function () {
@@ -140,9 +142,18 @@
$.fn.collapse.Constructor = Collapse
- /* COLLAPSIBLE DATA-API
+ /* COLLAPSE NO CONFLICT
* ==================== */
+ $.fn.collapse.noConflict = function () {
+ $.fn.collapse = old
+ return this
+ }
+
+
+ /* COLLAPSE DATA-API
+ * ================= */
+
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
, target = $this.attr('data-target')
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index f35b09746..65fc3ea86 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -53,9 +53,10 @@
if (!isActive) {
$parent.toggleClass('open')
- $this.focus()
}
+ $this.focus()
+
return false
}
@@ -82,7 +83,7 @@
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
- $items = $('[role=menu] li:not(.divider) a', $parent)
+ $items = $('[role=menu] li:not(.divider):visible a', $parent)
if (!$items.length) return
@@ -124,6 +125,8 @@
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
+ var old = $.fn.dropdown
+
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
@@ -136,6 +139,15 @@
$.fn.dropdown.Constructor = Dropdown
+ /* DROPDOWN NO CONFLICT
+ * ==================== */
+
+ $.fn.dropdown.noConflict = function () {
+ $.fn.dropdown = old
+ return this
+ }
+
+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index 9136a7f25..088f81447 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -193,6 +193,8 @@
/* MODAL PLUGIN DEFINITION
* ======================= */
+ var old = $.fn.modal
+
$.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
@@ -213,6 +215,15 @@
$.fn.modal.Constructor = Modal
+ /* MODAL NO CONFLICT
+ * ================= */
+
+ $.fn.modal.noConflict = function () {
+ $.fn.modal = old
+ return this
+ }
+
+
/* MODAL DATA-API
* ============== */
diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js
index 41dcdc010..dc639a63e 100644
--- a/js/bootstrap-popover.js
+++ b/js/bootstrap-popover.js
@@ -81,6 +81,8 @@
/* POPOVER PLUGIN DEFINITION
* ======================= */
+ var old = $.fn.popover
+
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
@@ -100,4 +102,13 @@
, template: '
'
})
+
+ /* POPOVER NO CONFLICT
+ * =================== */
+
+ $.fn.popover.noConflict = function () {
+ $.fn.popover = old
+ return this
+ }
+
}(window.jQuery);
diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js
index c515e31f9..b61c33006 100644
--- a/js/bootstrap-scrollspy.js
+++ b/js/bootstrap-scrollspy.js
@@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href)
return ( $href
&& $href.length
- && [[ $href.position().top, href ]] ) || null
+ && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
@@ -121,6 +121,8 @@
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
+ var old = $.fn.scrollspy
+
$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
@@ -138,6 +140,15 @@
}
+ /* SCROLLSPY NO CONFLICT
+ * ===================== */
+
+ $.fn.scrollspy.noConflict = function () {
+ $.fn.scrollspy = old
+ return this
+ }
+
+
/* SCROLLSPY DATA-API
* ================== */
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index 49b546ec8..2914cdb17 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -110,6 +110,8 @@
/* TAB PLUGIN DEFINITION
* ===================== */
+ var old = $.fn.tab
+
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
@@ -122,6 +124,15 @@
$.fn.tab.Constructor = Tab
+ /* TAB NO CONFLICT
+ * =============== */
+
+ $.fn.tab.noConflict = function () {
+ $.fn.tab = old
+ return this
+ }
+
+
/* TAB DATA-API
* ============ */
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js
index ef6572db7..5a574fcf0 100644
--- a/js/bootstrap-tooltip.js
+++ b/js/bootstrap-tooltip.js
@@ -250,6 +250,8 @@
/* TOOLTIP PLUGIN DEFINITION
* ========================= */
+ var old = $.fn.tooltip
+
$.fn.tooltip = function ( option ) {
return this.each(function () {
var $this = $(this)
@@ -273,4 +275,13 @@
, html: false
}
+
+ /* TOOLTIP NO CONFLICT
+ * =================== */
+
+ $.fn.tooltip.noConflict = function () {
+ $.fn.tooltip = old
+ return this
+ }
+
}(window.jQuery);
\ No newline at end of file
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js
index f1ab231b3..94101db05 100644
--- a/js/bootstrap-typeahead.js
+++ b/js/bootstrap-typeahead.js
@@ -33,8 +33,8 @@
this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater
- this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source
+ this.$menu = $(this.options.menu)
this.shown = false
this.listen()
}
@@ -56,16 +56,18 @@
}
, show: function () {
- var pos = $.extend({}, this.$element.offset(), {
+ var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
})
- this.$menu.css({
- top: pos.top + pos.height
- , left: pos.left
- })
+ this.$menu
+ .insertAfter(this.$element)
+ .css({
+ top: pos.top + pos.height
+ , left: pos.left
+ })
+ .show()
- this.$menu.show()
this.shown = true
return this
}
@@ -217,7 +219,7 @@
}
, keydown: function (e) {
- this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
+ this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
this.move(e)
}
@@ -276,6 +278,8 @@
/* TYPEAHEAD PLUGIN DEFINITION
* =========================== */
+ var old = $.fn.typeahead
+
$.fn.typeahead = function (option) {
return this.each(function () {
var $this = $(this)
@@ -297,7 +301,16 @@
$.fn.typeahead.Constructor = Typeahead
- /* TYPEAHEAD DATA-API
+ /* TYPEAHEAD NO CONFLICT
+ * =================== */
+
+ $.fn.typeahead.noConflict = function () {
+ $.fn.typeahead = old
+ return this
+ }
+
+
+ /* TYPEAHEAD DATA-API
* ================== */
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
diff --git a/js/tests/unit/bootstrap-affix.js b/js/tests/unit/bootstrap-affix.js
index bc25df991..c97887890 100644
--- a/js/tests/unit/bootstrap-affix.js
+++ b/js/tests/unit/bootstrap-affix.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-affix")
+ test("should provide no conflict", function () {
+ var affix = $.fn.affix.noConflict()
+ ok(!$.fn.affix, 'affix was set back to undefined (org value)')
+ $.fn.affix = affix
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).affix, 'affix method is defined')
})
diff --git a/js/tests/unit/bootstrap-alert.js b/js/tests/unit/bootstrap-alert.js
index 7f24e0e6b..9a6b514c4 100644
--- a/js/tests/unit/bootstrap-alert.js
+++ b/js/tests/unit/bootstrap-alert.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-alerts")
+ test("should provide no conflict", function () {
+ var alert = $.fn.alert.noConflict()
+ ok(!$.fn.alert, 'alert was set back to undefined (org value)')
+ $.fn.alert = alert
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).alert, 'alert method is defined')
})
diff --git a/js/tests/unit/bootstrap-button.js b/js/tests/unit/bootstrap-button.js
index b5d083499..e23ff9e30 100644
--- a/js/tests/unit/bootstrap-button.js
+++ b/js/tests/unit/bootstrap-button.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-buttons")
+ test("should provide no conflict", function () {
+ var button = $.fn.button.noConflict()
+ ok(!$.fn.button, 'button was set back to undefined (org value)')
+ $.fn.button = button
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).button, 'button method is defined')
})
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js
index 8bd1b62ba..13b8f721f 100644
--- a/js/tests/unit/bootstrap-carousel.js
+++ b/js/tests/unit/bootstrap-carousel.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-carousel")
+ test("should provide no conflict", function () {
+ var carousel = $.fn.carousel.noConflict()
+ ok(!$.fn.carousel, 'carousel was set back to undefined (org value)')
+ $.fn.carousel = carousel
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).carousel, 'carousel method is defined')
})
diff --git a/js/tests/unit/bootstrap-collapse.js b/js/tests/unit/bootstrap-collapse.js
index 6cc7ac7a4..4c5916ecd 100644
--- a/js/tests/unit/bootstrap-collapse.js
+++ b/js/tests/unit/bootstrap-collapse.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-collapse")
+ test("should provide no conflict", function () {
+ var collapse = $.fn.collapse.noConflict()
+ ok(!$.fn.collapse, 'collapse was set back to undefined (org value)')
+ $.fn.collapse = collapse
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).collapse, 'collapse method is defined')
})
diff --git a/js/tests/unit/bootstrap-dropdown.js b/js/tests/unit/bootstrap-dropdown.js
index 3788209ec..2f0d2d29e 100644
--- a/js/tests/unit/bootstrap-dropdown.js
+++ b/js/tests/unit/bootstrap-dropdown.js
@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-dropdowns")
+ test("should provide no conflict", function () {
+ var dropdown = $.fn.dropdown.noConflict()
+ ok(!$.fn.dropdown, 'dropdown was set back to undefined (org value)')
+ $.fn.dropdown = dropdown
+ })
+
test("should be defined on jquery object", function () {
ok($(document.body).dropdown, 'dropdown method is defined')
})
@@ -104,7 +110,7 @@ $(function () {
})
test("should remove open class if body clicked, with multiple drop downs", function () {
- var dropdownHTML =
+ var dropdownHTML =
'
-
+
Nesting and striping
+
+
+
+ Test
+
+
+
+
+
+
+
+
+ Test
+ Test
+
+
+
+
+
+ test
+
+
+ test
+
+
+
+
+ test
+
+
+ test
+
+
+
+
+ test
+
+
+ test
+
+
+
+
+
+
+
+