Skip to content

Commit

Permalink
add noConflict functionality to all bootstrap plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Dec 7, 2012
1 parent 1c5b8e9 commit a7eb9c2
Show file tree
Hide file tree
Showing 40 changed files with 519 additions and 22 deletions.
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-affix.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
/* AFFIX PLUGIN DEFINITION
* ======================= */

var old = $.fn.affix

$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -85,6 +87,15 @@
}


/* AFFIX NO CONFLICT
* ================= */

$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}


/* AFFIX DATA-API
* ============== */

Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
/* ALERT PLUGIN DEFINITION
* ======================= */

var old = $.fn.alert

$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -80,6 +82,15 @@
$.fn.alert.Constructor = Alert


/* ALERT NO CONFLICT
* ================= */

$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}


/* ALERT DATA-API
* ============== */

Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
/* BUTTON PLUGIN DEFINITION
* ======================== */

var old = $.fn.button

$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -82,6 +84,15 @@
$.fn.button.Constructor = Button


/* BUTTON NO CONFLICT
* ================== */

$.fn.button.noConflict = function () {
$.fn.button = old
return this
}


/* BUTTON DATA-API
* =============== */

Expand Down
10 changes: 10 additions & 0 deletions docs/assets/js/bootstrap-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
/* CAROUSEL PLUGIN DEFINITION
* ========================== */

var old = $.fn.carousel

$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -162,6 +164,14 @@
$.fn.carousel.Constructor = Carousel


/* CAROUSEL NO CONFLICT
* ==================== */

$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}

/* CAROUSEL DATA-API
* ================= */

Expand Down
17 changes: 14 additions & 3 deletions docs/assets/js/bootstrap-collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
}


/* COLLAPSIBLE PLUGIN DEFINITION
* ============================== */
/* COLLAPSE PLUGIN DEFINITION
* ========================== */

var old = $.fn.collapse

$.fn.collapse = function (option) {
return this.each(function () {
Expand All @@ -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')
Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
/* DROPDOWN PLUGIN DEFINITION
* ========================== */

var old = $.fn.dropdown

$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -136,6 +138,15 @@
$.fn.dropdown.Constructor = Dropdown


/* DROPDOWN NO CONFLICT
* ==================== */

$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}


/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */

Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@
/* MODAL PLUGIN DEFINITION
* ======================= */

var old = $.fn.modal

$.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -213,6 +215,15 @@
$.fn.modal.Constructor = Modal


/* MODAL NO CONFLICT
* ================= */

$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}


/* MODAL DATA-API
* ============== */

Expand Down
13 changes: 12 additions & 1 deletion docs/assets/js/bootstrap-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
/* POPOVER PLUGIN DEFINITION
* ======================= */

var old = $.fn.popover

$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -100,4 +102,13 @@
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
})

}(window.jQuery);

/* POPOVER NO CONFLICT
* =================== */

$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}

}(window.jQuery);
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */

var old = $.fn.scrollspy

$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -138,6 +140,15 @@
}


/* SCROLLSPY NO CONFLICT
* ===================== */

$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}


/* SCROLLSPY DATA-API
* ================== */

Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@
/* TAB PLUGIN DEFINITION
* ===================== */

var old = $.fn.tab

$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
Expand All @@ -122,6 +124,15 @@
$.fn.tab.Constructor = Tab


/* TAB NO CONFLICT
* =============== */

$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}


/* TAB DATA-API
* ============ */

Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/bootstrap-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@
/* TOOLTIP PLUGIN DEFINITION
* ========================= */

var old = $.fn.tooltip

$.fn.tooltip = function ( option ) {
return this.each(function () {
var $this = $(this)
Expand All @@ -273,4 +275,13 @@
, html: false
}


/* TOOLTIP NO CONFLICT
* =================== */

$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}

}(window.jQuery);
13 changes: 12 additions & 1 deletion docs/assets/js/bootstrap-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@
/* TYPEAHEAD PLUGIN DEFINITION
* =========================== */

var old = $.fn.typeahead

$.fn.typeahead = function (option) {
return this.each(function () {
var $this = $(this)
Expand All @@ -297,7 +299,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) {
Expand Down
Loading

0 comments on commit a7eb9c2

Please sign in to comment.