Commit bc0b94a3 authored by Mark Otto's avatar Mark Otto

Merge branch 'master' into 3.0.0-wip

Conflicts:
	docs/assets/css/bootstrap.css
	docs/assets/js/bootstrap.js
	docs/css.html
	docs/templates/pages/base-css.mustache
	docs/templates/pages/components.mustache
	docs/templates/pages/javascript.mustache
	less/breadcrumbs.less
	less/tables.less
	less/tests/css-tests.html
parents be5f3148 9376a7c2
...@@ -700,6 +700,8 @@ pre.prettyprint { ...@@ -700,6 +700,8 @@ pre.prettyprint {
pre code { pre code {
padding: 0; padding: 0;
color: inherit; color: inherit;
white-space: pre;
white-space: pre-wrap;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
} }
...@@ -1684,6 +1686,10 @@ table { ...@@ -1684,6 +1686,10 @@ table {
border-top: 2px solid #dddddd; border-top: 2px solid #dddddd;
} }
.table .table {
background-color: #ffffff;
}
.table-condensed th, .table-condensed th,
.table-condensed td { .table-condensed td {
padding: 4px 5px; padding: 4px 5px;
...@@ -1713,33 +1719,33 @@ table { ...@@ -1713,33 +1719,33 @@ table {
border-top: 0; border-top: 0;
} }
.table-bordered thead:first-child tr:first-child th:first-child, .table-bordered thead:first-child tr:first-child > th:first-child,
.table-bordered tbody:first-child tr:first-child td:first-child { .table-bordered tbody:first-child tr:first-child > td:first-child {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
.table-bordered thead:first-child tr:first-child th:last-child, .table-bordered thead:first-child tr:first-child > th:last-child,
.table-bordered tbody:first-child tr:first-child td:last-child { .table-bordered tbody:first-child tr:first-child > td:last-child {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
.table-bordered thead:last-child tr:last-child th:first-child, .table-bordered thead:last-child tr:last-child > th:first-child,
.table-bordered tbody:last-child tr:last-child td:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child,
.table-bordered tfoot:last-child tr:last-child td:first-child { .table-bordered tfoot:last-child tr:last-child > td:first-child {
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
} }
.table-bordered thead:last-child tr:last-child th:last-child, .table-bordered thead:last-child tr:last-child > th:last-child,
.table-bordered tbody:last-child tr:last-child td:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child,
.table-bordered tfoot:last-child tr:last-child td:last-child { .table-bordered tfoot:last-child tr:last-child > td:last-child {
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
} }
.table-bordered tfoot + tbody:last-child tr:last-child td:first-child { .table-bordered tfoot + tbody:last-child tr:last-child > td:first-child {
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.table-bordered tfoot + tbody:last-child tr:last-child td:last-child { .table-bordered tfoot + tbody:last-child tr:last-child > td:last-child {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
...@@ -1757,8 +1763,8 @@ table { ...@@ -1757,8 +1763,8 @@ table {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
.table-striped tbody tr:nth-child(odd) td, .table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody tr:nth-child(odd) th { .table-striped tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
...@@ -2827,6 +2833,11 @@ button.close { ...@@ -2827,6 +2833,11 @@ button.close {
border-radius: 3px; border-radius: 3px;
} }
.btn-mini [class^="icon-"],
.btn-mini [class*=" icon-"] {
margin-top: -1px;
}
.btn-mini { .btn-mini {
padding: 0 6px; padding: 0 6px;
font-size: 10.5px; font-size: 10.5px;
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
/* AFFIX PLUGIN DEFINITION /* AFFIX PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.affix
$.fn.affix = function (option) { $.fn.affix = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -85,6 +87,15 @@ ...@@ -85,6 +87,15 @@
} }
/* AFFIX NO CONFLICT
* ================= */
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
/* AFFIX DATA-API /* AFFIX DATA-API
* ============== */ * ============== */
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
/* ALERT PLUGIN DEFINITION /* ALERT PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.alert
$.fn.alert = function (option) { $.fn.alert = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -80,6 +82,15 @@ ...@@ -80,6 +82,15 @@
$.fn.alert.Constructor = Alert $.fn.alert.Constructor = Alert
/* ALERT NO CONFLICT
* ================= */
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
/* ALERT DATA-API /* ALERT DATA-API
* ============== */ * ============== */
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
/* BUTTON PLUGIN DEFINITION /* BUTTON PLUGIN DEFINITION
* ======================== */ * ======================== */
var old = $.fn.button
$.fn.button = function (option) { $.fn.button = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -82,6 +84,15 @@ ...@@ -82,6 +84,15 @@
$.fn.button.Constructor = Button $.fn.button.Constructor = Button
/* BUTTON NO CONFLICT
* ================== */
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
/* BUTTON DATA-API /* BUTTON DATA-API
* =============== */ * =============== */
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
var Carousel = function (element, options) { var Carousel = function (element, options) {
this.$element = $(element) this.$element = $(element)
this.options = options this.options = options
this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this)) .on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this)) .on('mouseleave', $.proxy(this.cycle, this))
...@@ -141,6 +140,8 @@ ...@@ -141,6 +140,8 @@
/* CAROUSEL PLUGIN DEFINITION /* CAROUSEL PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.carousel
$.fn.carousel = function (option) { $.fn.carousel = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -162,6 +163,14 @@ ...@@ -162,6 +163,14 @@
$.fn.carousel.Constructor = Carousel $.fn.carousel.Constructor = Carousel
/* CAROUSEL NO CONFLICT
* ==================== */
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
......
...@@ -120,8 +120,10 @@ ...@@ -120,8 +120,10 @@
} }
/* COLLAPSIBLE PLUGIN DEFINITION /* COLLAPSE PLUGIN DEFINITION
* ============================== */ * ========================== */
var old = $.fn.collapse
$.fn.collapse = function (option) { $.fn.collapse = function (option) {
return this.each(function () { return this.each(function () {
...@@ -140,9 +142,18 @@ ...@@ -140,9 +142,18 @@
$.fn.collapse.Constructor = Collapse $.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) { $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href var $this = $(this), href
, target = $this.attr('data-target') , target = $this.attr('data-target')
......
...@@ -53,9 +53,10 @@ ...@@ -53,9 +53,10 @@
if (!isActive) { if (!isActive) {
$parent.toggleClass('open') $parent.toggleClass('open')
$this.focus()
} }
$this.focus()
return false return false
} }
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() 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 if (!$items.length) return
...@@ -124,6 +125,8 @@ ...@@ -124,6 +125,8 @@
/* DROPDOWN PLUGIN DEFINITION /* DROPDOWN PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.dropdown
$.fn.dropdown = function (option) { $.fn.dropdown = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -136,6 +139,15 @@ ...@@ -136,6 +139,15 @@
$.fn.dropdown.Constructor = Dropdown $.fn.dropdown.Constructor = Dropdown
/* DROPDOWN NO CONFLICT
* ==================== */
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS /* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */ * =================================== */
......
...@@ -193,6 +193,8 @@ ...@@ -193,6 +193,8 @@
/* MODAL PLUGIN DEFINITION /* MODAL PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.modal
$.fn.modal = function (option) { $.fn.modal = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -213,6 +215,15 @@ ...@@ -213,6 +215,15 @@
$.fn.modal.Constructor = Modal $.fn.modal.Constructor = Modal
/* MODAL NO CONFLICT
* ================= */
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
/* MODAL DATA-API /* MODAL DATA-API
* ============== */ * ============== */
......
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
/* POPOVER PLUGIN DEFINITION /* POPOVER PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.popover
$.fn.popover = function (option) { $.fn.popover = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -100,4 +102,13 @@ ...@@ -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>' , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
}) })
/* POPOVER NO CONFLICT
* =================== */
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(window.jQuery); }(window.jQuery);
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top, href ]] ) || null && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
.each(function () { .each(function () {
...@@ -121,6 +121,8 @@ ...@@ -121,6 +121,8 @@
/* SCROLLSPY PLUGIN DEFINITION /* SCROLLSPY PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) { $.fn.scrollspy = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -138,6 +140,15 @@ ...@@ -138,6 +140,15 @@
} }
/* SCROLLSPY NO CONFLICT
* ===================== */
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
/* SCROLLSPY DATA-API /* SCROLLSPY DATA-API
* ================== */ * ================== */
......
...@@ -110,6 +110,8 @@ ...@@ -110,6 +110,8 @@
/* TAB PLUGIN DEFINITION /* TAB PLUGIN DEFINITION
* ===================== */ * ===================== */
var old = $.fn.tab
$.fn.tab = function ( option ) { $.fn.tab = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -122,6 +124,15 @@ ...@@ -122,6 +124,15 @@
$.fn.tab.Constructor = Tab $.fn.tab.Constructor = Tab
/* TAB NO CONFLICT
* =============== */
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
/* TAB DATA-API /* TAB DATA-API
* ============ */ * ============ */
......
...@@ -250,6 +250,8 @@ ...@@ -250,6 +250,8 @@
/* TOOLTIP PLUGIN DEFINITION /* TOOLTIP PLUGIN DEFINITION
* ========================= */ * ========================= */
var old = $.fn.tooltip
$.fn.tooltip = function ( option ) { $.fn.tooltip = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -273,4 +275,13 @@ ...@@ -273,4 +275,13 @@
, html: false , html: false
} }
/* TOOLTIP NO CONFLICT
* =================== */
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
this.sorter = this.options.sorter || this.sorter this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater this.updater = this.options.updater || this.updater
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source this.source = this.options.source
this.$menu = $(this.options.menu)
this.shown = false this.shown = false
this.listen() this.listen()
} }
...@@ -56,16 +56,18 @@ ...@@ -56,16 +56,18 @@
} }
, show: function () { , show: function () {
var pos = $.extend({}, this.$element.offset(), { var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight height: this.$element[0].offsetHeight
}) })
this.$menu.css({ this.$menu
top: pos.top + pos.height .insertAfter(this.$element)
, left: pos.left .css({
}) top: pos.top + pos.height
, left: pos.left
})
.show()
this.$menu.show()
this.shown = true this.shown = true
return this return this
} }
...@@ -217,7 +219,7 @@ ...@@ -217,7 +219,7 @@
} }
, keydown: function (e) { , 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) this.move(e)
} }
...@@ -276,6 +278,8 @@ ...@@ -276,6 +278,8 @@
/* TYPEAHEAD PLUGIN DEFINITION /* TYPEAHEAD PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.typeahead
$.fn.typeahead = function (option) { $.fn.typeahead = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -297,7 +301,16 @@ ...@@ -297,7 +301,16 @@
$.fn.typeahead.Constructor = Typeahead $.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) { $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
......
...@@ -127,6 +127,8 @@ ...@@ -127,6 +127,8 @@
/* ALERT PLUGIN DEFINITION /* ALERT PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.alert
$.fn.alert = function (option) { $.fn.alert = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -139,6 +141,15 @@ ...@@ -139,6 +141,15 @@
$.fn.alert.Constructor = Alert $.fn.alert.Constructor = Alert
/* ALERT NO CONFLICT
* ================= */
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
/* ALERT DATA-API /* ALERT DATA-API
* ============== */ * ============== */
...@@ -210,6 +221,8 @@ ...@@ -210,6 +221,8 @@
/* BUTTON PLUGIN DEFINITION /* BUTTON PLUGIN DEFINITION
* ======================== */ * ======================== */
var old = $.fn.button
$.fn.button = function (option) { $.fn.button = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -228,6 +241,15 @@ ...@@ -228,6 +241,15 @@
$.fn.button.Constructor = Button $.fn.button.Constructor = Button
/* BUTTON NO CONFLICT
* ================== */
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
/* BUTTON DATA-API /* BUTTON DATA-API
* =============== */ * =============== */
...@@ -268,7 +290,6 @@ ...@@ -268,7 +290,6 @@
var Carousel = function (element, options) { var Carousel = function (element, options) {
this.$element = $(element) this.$element = $(element)
this.options = options this.options = options
this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this)) .on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this)) .on('mouseleave', $.proxy(this.cycle, this))
...@@ -380,6 +401,8 @@ ...@@ -380,6 +401,8 @@
/* CAROUSEL PLUGIN DEFINITION /* CAROUSEL PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.carousel
$.fn.carousel = function (option) { $.fn.carousel = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -401,6 +424,14 @@ ...@@ -401,6 +424,14 @@
$.fn.carousel.Constructor = Carousel $.fn.carousel.Constructor = Carousel
/* CAROUSEL NO CONFLICT
* ==================== */
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
...@@ -534,8 +565,10 @@ ...@@ -534,8 +565,10 @@
} }
/* COLLAPSIBLE PLUGIN DEFINITION /* COLLAPSE PLUGIN DEFINITION
* ============================== */ * ========================== */
var old = $.fn.collapse
$.fn.collapse = function (option) { $.fn.collapse = function (option) {
return this.each(function () { return this.each(function () {
...@@ -554,9 +587,18 @@ ...@@ -554,9 +587,18 @@
$.fn.collapse.Constructor = Collapse $.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) { $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href var $this = $(this), href
, target = $this.attr('data-target') , target = $this.attr('data-target')
...@@ -622,9 +664,10 @@ ...@@ -622,9 +664,10 @@
if (!isActive) { if (!isActive) {
$parent.toggleClass('open') $parent.toggleClass('open')
$this.focus()
} }
$this.focus()
return false return false
} }
...@@ -651,7 +694,7 @@ ...@@ -651,7 +694,7 @@
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() 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 if (!$items.length) return
...@@ -693,6 +736,8 @@ ...@@ -693,6 +736,8 @@
/* DROPDOWN PLUGIN DEFINITION /* DROPDOWN PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.dropdown
$.fn.dropdown = function (option) { $.fn.dropdown = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -705,6 +750,15 @@ ...@@ -705,6 +750,15 @@
$.fn.dropdown.Constructor = Dropdown $.fn.dropdown.Constructor = Dropdown
/* DROPDOWN NO CONFLICT
* ==================== */
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS /* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */ * =================================== */
...@@ -910,6 +964,8 @@ ...@@ -910,6 +964,8 @@
/* MODAL PLUGIN DEFINITION /* MODAL PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.modal
$.fn.modal = function (option) { $.fn.modal = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -930,6 +986,15 @@ ...@@ -930,6 +986,15 @@
$.fn.modal.Constructor = Modal $.fn.modal.Constructor = Modal
/* MODAL NO CONFLICT
* ================= */
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
/* MODAL DATA-API /* MODAL DATA-API
* ============== */ * ============== */
...@@ -1201,6 +1266,8 @@ ...@@ -1201,6 +1266,8 @@
/* TOOLTIP PLUGIN DEFINITION /* TOOLTIP PLUGIN DEFINITION
* ========================= */ * ========================= */
var old = $.fn.tooltip
$.fn.tooltip = function ( option ) { $.fn.tooltip = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -1224,6 +1291,15 @@ ...@@ -1224,6 +1291,15 @@
, html: false , html: false
} }
/* TOOLTIP NO CONFLICT
* =================== */
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(window.jQuery);/* =========================================================== }(window.jQuery);/* ===========================================================
* bootstrap-popover.js v3.0.0 * bootstrap-popover.js v3.0.0
* http://twitter.github.com/bootstrap/javascript.html#popovers * http://twitter.github.com/bootstrap/javascript.html#popovers
...@@ -1307,6 +1383,8 @@ ...@@ -1307,6 +1383,8 @@
/* POPOVER PLUGIN DEFINITION /* POPOVER PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.popover
$.fn.popover = function (option) { $.fn.popover = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -1326,6 +1404,15 @@ ...@@ -1326,6 +1404,15 @@
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>' , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
}) })
/* POPOVER NO CONFLICT
* =================== */
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(window.jQuery); }(window.jQuery);
/* ============================================================= /* =============================================================
* bootstrap-scrollspy.js v3.0.0 * bootstrap-scrollspy.js v3.0.0
...@@ -1388,7 +1475,7 @@ ...@@ -1388,7 +1475,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top, href ]] ) || null && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
.each(function () { .each(function () {
...@@ -1450,6 +1537,8 @@ ...@@ -1450,6 +1537,8 @@
/* SCROLLSPY PLUGIN DEFINITION /* SCROLLSPY PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) { $.fn.scrollspy = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -1467,6 +1556,15 @@ ...@@ -1467,6 +1556,15 @@
} }
/* SCROLLSPY NO CONFLICT
* ===================== */
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
/* SCROLLSPY DATA-API /* SCROLLSPY DATA-API
* ================== */ * ================== */
...@@ -1589,6 +1687,8 @@ ...@@ -1589,6 +1687,8 @@
/* TAB PLUGIN DEFINITION /* TAB PLUGIN DEFINITION
* ===================== */ * ===================== */
var old = $.fn.tab
$.fn.tab = function ( option ) { $.fn.tab = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -1601,6 +1701,15 @@ ...@@ -1601,6 +1701,15 @@
$.fn.tab.Constructor = Tab $.fn.tab.Constructor = Tab
/* TAB NO CONFLICT
* =============== */
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
/* TAB DATA-API /* TAB DATA-API
* ============ */ * ============ */
...@@ -1644,8 +1753,8 @@ ...@@ -1644,8 +1753,8 @@
this.sorter = this.options.sorter || this.sorter this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater this.updater = this.options.updater || this.updater
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source this.source = this.options.source
this.$menu = $(this.options.menu)
this.shown = false this.shown = false
this.listen() this.listen()
} }
...@@ -1667,16 +1776,18 @@ ...@@ -1667,16 +1776,18 @@
} }
, show: function () { , show: function () {
var pos = $.extend({}, this.$element.offset(), { var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight height: this.$element[0].offsetHeight
}) })
this.$menu.css({ this.$menu
top: pos.top + pos.height .insertAfter(this.$element)
, left: pos.left .css({
}) top: pos.top + pos.height
, left: pos.left
})
.show()
this.$menu.show()
this.shown = true this.shown = true
return this return this
} }
...@@ -1828,7 +1939,7 @@ ...@@ -1828,7 +1939,7 @@
} }
, keydown: function (e) { , 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) this.move(e)
} }
...@@ -1887,6 +1998,8 @@ ...@@ -1887,6 +1998,8 @@
/* TYPEAHEAD PLUGIN DEFINITION /* TYPEAHEAD PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.typeahead
$.fn.typeahead = function (option) { $.fn.typeahead = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -1908,7 +2021,16 @@ ...@@ -1908,7 +2021,16 @@
$.fn.typeahead.Constructor = Typeahead $.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) { $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
...@@ -1989,6 +2111,8 @@ ...@@ -1989,6 +2111,8 @@
/* AFFIX PLUGIN DEFINITION /* AFFIX PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.affix
$.fn.affix = function (option) { $.fn.affix = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -2006,6 +2130,15 @@ ...@@ -2006,6 +2130,15 @@
} }
/* AFFIX NO CONFLICT
* ================= */
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
/* AFFIX DATA-API /* AFFIX DATA-API
* ============== */ * ============== */
......
This diff is collapsed.
...@@ -1823,16 +1823,16 @@ ...@@ -1823,16 +1823,16 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="alert"&gt; &lt;div class="alert"&gt;
&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;
&lt;strong&gt;Warning!&lt;/strong&gt; Best check yo self, you're not looking too good. &lt;strong&gt;Warning!&lt;/strong&gt; Best check yo self, you're not looking too good.
&lt;/div&gt; &lt;/div&gt;
</pre> </pre>
<h3>Dismiss buttons</h3> <h3>Dismiss buttons</h3>
<p>Mobile Safari and Mobile Opera browsers, in addition to the <code>data-dismiss="alert"</code> attribute, require an <code>href="#"</code> for the dismissal of alerts when using an <code>&lt;a&gt;</code> tag.</p> <p>Mobile Safari and Mobile Opera browsers, in addition to the <code>data-dismiss="alert"</code> attribute, require an <code>href="#"</code> for the dismissal of alerts when using an <code>&lt;a&gt;</code> tag.</p>
<pre class="prettyprint linenums">&lt;a href="#" class="close" data-dismiss="alert"&gt;&times;&lt;/a&gt;</pre> <pre class="prettyprint linenums">&lt;a href="#" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/a&gt;</pre>
<p>Alternatively, you may use a <code>&lt;button&gt;</code> element with the data attribute, which we have opted to do for our docs. When using <code>&lt;button&gt;</code>, you must include <code>type="button"</code> or your forms may not submit.</p> <p>Alternatively, you may use a <code>&lt;button&gt;</code> element with the data attribute, which we have opted to do for our docs. When using <code>&lt;button&gt;</code>, you must include <code>type="button"</code> or your forms may not submit.</p>
<pre class="prettyprint linenums">&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;</pre>
<h3>Dismiss alerts via JavaScript</h3> <h3>Dismiss alerts via JavaScript</h3>
<p>Use the <a href="./javascript.html#alerts">alerts jQuery plugin</a> for quick and easy dismissal of alerts.</p> <p>Use the <a href="./javascript.html#alerts">alerts jQuery plugin</a> for quick and easy dismissal of alerts.</p>
...@@ -1852,7 +1852,7 @@ ...@@ -1852,7 +1852,7 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="alert alert-block"&gt; &lt;div class="alert alert-block"&gt;
&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;
&lt;h4&gt;Warning!&lt;/h4&gt; &lt;h4&gt;Warning!&lt;/h4&gt;
Best check yo self, you're not... Best check yo self, you're not...
&lt;/div&gt; &lt;/div&gt;
......
...@@ -131,9 +131,17 @@ $("#myModal").modal('show') // initializes and invokes show immed ...@@ -131,9 +131,17 @@ $("#myModal").modal('show') // initializes and invokes show immed
</pre> </pre>
<p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p> <p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p>
<h3>No conflict</h3>
<p>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 <code>.noCoflict</code> on the plugin you wish to revert the value of.</p>
<pre class="prettyprint linenums">
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality
</pre>
<h3>Events</h3> <h3>Events</h3>
<p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p> <p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p>
<p>All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.</p> <p>All infinitive events provide <code>preventDefault</code> functionality. This provides the ability to stop the execution of an action before it starts.</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
$('#myModal').on('show', function (e) { $('#myModal').on('show', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown if (!data) return e.preventDefault() // stops modal from being shown
...@@ -1122,7 +1130,7 @@ $('#my-alert').bind('closed', function () { ...@@ -1122,7 +1130,7 @@ $('#my-alert').bind('closed', function () {
<p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p> <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p>
<h4>Stateful</h4> <h4>Stateful</h4>
<p>Add data-loading-text="Loading..." to use a loading state on a button.</p> <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary"> <button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary">
Loading state Loading state
...@@ -1131,14 +1139,14 @@ $('#my-alert').bind('closed', function () { ...@@ -1131,14 +1139,14 @@ $('#my-alert').bind('closed', function () {
<pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-loading-text="Loading..."&gt;Loading state&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-loading-text="Loading..."&gt;Loading state&lt;/button&gt;</pre>
<h4>Single toggle</h4> <h4>Single toggle</h4>
<p>Add data-toggle="button" to activate toggling on a single button.</p> <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button> <button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
</div> </div>
<pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-toggle="button"&gt;Single Toggle&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-toggle="button"&gt;Single Toggle&lt;/button&gt;</pre>
<h4>Checkbox</h4> <h4>Checkbox</h4>
<p>Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.</p> <p>Add <code>data-toggle="buttons-checkbox"</code> for checkbox style toggling on btn-group.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<div class="btn-group" data-toggle="buttons-checkbox"> <div class="btn-group" data-toggle="buttons-checkbox">
<button type="button" class="btn btn-primary">Left</button> <button type="button" class="btn btn-primary">Left</button>
...@@ -1155,7 +1163,7 @@ $('#my-alert').bind('closed', function () { ...@@ -1155,7 +1163,7 @@ $('#my-alert').bind('closed', function () {
</pre> </pre>
<h4>Radio</h4> <h4>Radio</h4>
<p>Add data-toggle="buttons-radio" for radio style toggling on btn-group.</p> <p>Add <code>data-toggle="buttons-radio"</code> for radio style toggling on btn-group.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn btn-primary">Left</button> <button type="button" class="btn btn-primary">Left</button>
......
...@@ -1755,16 +1755,16 @@ ...@@ -1755,16 +1755,16 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="alert"&gt; &lt;div class="alert"&gt;
&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;
&lt;strong&gt;Warning!&lt;/strong&gt; Best check yo self, you're not looking too good. &lt;strong&gt;Warning!&lt;/strong&gt; Best check yo self, you're not looking too good.
&lt;/div&gt; &lt;/div&gt;
</pre> </pre>
<h3>Dismiss buttons</h3> <h3>Dismiss buttons</h3>
<p>Mobile Safari and Mobile Opera browsers, in addition to the <code>data-dismiss="alert"</code> attribute, require an <code>href="#"</code> for the dismissal of alerts when using an <code>&lt;a&gt;</code> tag.</p> <p>Mobile Safari and Mobile Opera browsers, in addition to the <code>data-dismiss="alert"</code> attribute, require an <code>href="#"</code> for the dismissal of alerts when using an <code>&lt;a&gt;</code> tag.</p>
<pre class="prettyprint linenums">&lt;a href="#" class="close" data-dismiss="alert"&gt;&times;&lt;/a&gt;</pre> <pre class="prettyprint linenums">&lt;a href="#" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/a&gt;</pre>
<p>Alternatively, you may use a <code>&lt;button&gt;</code> element with the data attribute, which we have opted to do for our docs. When using <code>&lt;button&gt;</code>, you must include <code>type="button"</code> or your forms may not submit.</p> <p>Alternatively, you may use a <code>&lt;button&gt;</code> element with the data attribute, which we have opted to do for our docs. When using <code>&lt;button&gt;</code>, you must include <code>type="button"</code> or your forms may not submit.</p>
<pre class="prettyprint linenums">&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;</pre>
<h3>Dismiss alerts via JavaScript</h3> <h3>Dismiss alerts via JavaScript</h3>
<p>Use the <a href="./javascript.html#alerts">alerts jQuery plugin</a> for quick and easy dismissal of alerts.</p> <p>Use the <a href="./javascript.html#alerts">alerts jQuery plugin</a> for quick and easy dismissal of alerts.</p>
...@@ -1784,7 +1784,7 @@ ...@@ -1784,7 +1784,7 @@
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="alert alert-block"&gt; &lt;div class="alert alert-block"&gt;
&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;
&lt;h4&gt;Warning!&lt;/h4&gt; &lt;h4&gt;Warning!&lt;/h4&gt;
Best check yo self, you're not... Best check yo self, you're not...
&lt;/div&gt; &lt;/div&gt;
......
...@@ -63,9 +63,17 @@ $("#myModal").modal('show') // initializes and invokes show immed ...@@ -63,9 +63,17 @@ $("#myModal").modal('show') // initializes and invokes show immed
</pre> </pre>
<p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p> <p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p>
<h3>No conflict</h3>
<p>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 <code>.noCoflict</code> on the plugin you wish to revert the value of.</p>
<pre class="prettyprint linenums">
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality
</pre>
<h3>Events</h3> <h3>Events</h3>
<p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p> <p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p>
<p>All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.</p> <p>All infinitive events provide <code>preventDefault</code> functionality. This provides the ability to stop the execution of an action before it starts.</p>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
$('#myModal').on('show', function (e) { $('#myModal').on('show', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown if (!data) return e.preventDefault() // stops modal from being shown
...@@ -1055,7 +1063,7 @@ $('#my-alert').bind('closed', function () { ...@@ -1055,7 +1063,7 @@ $('#my-alert').bind('closed', function () {
<p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p> <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p>
<h4>Stateful</h4> <h4>Stateful</h4>
<p>Add data-loading-text="Loading..." to use a loading state on a button.</p> <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary"> <button type="button" id="fat-btn" data-loading-text="loading..." class="btn btn-primary">
Loading state Loading state
...@@ -1064,14 +1072,14 @@ $('#my-alert').bind('closed', function () { ...@@ -1064,14 +1072,14 @@ $('#my-alert').bind('closed', function () {
<pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-loading-text="Loading..."&gt;Loading state&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-loading-text="Loading..."&gt;Loading state&lt;/button&gt;</pre>
<h4>Single toggle</h4> <h4>Single toggle</h4>
<p>Add data-toggle="button" to activate toggling on a single button.</p> <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button> <button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
</div>{{! /example }} </div>{{! /example }}
<pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-toggle="button"&gt;Single Toggle&lt;/button&gt;</pre> <pre class="prettyprint linenums">&lt;button type="button" class="btn btn-primary" data-toggle="button"&gt;Single Toggle&lt;/button&gt;</pre>
<h4>Checkbox</h4> <h4>Checkbox</h4>
<p>Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.</p> <p>Add <code>data-toggle="buttons-checkbox"</code> for checkbox style toggling on btn-group.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<div class="btn-group" data-toggle="buttons-checkbox"> <div class="btn-group" data-toggle="buttons-checkbox">
<button type="button" class="btn btn-primary">Left</button> <button type="button" class="btn btn-primary">Left</button>
...@@ -1088,7 +1096,7 @@ $('#my-alert').bind('closed', function () { ...@@ -1088,7 +1096,7 @@ $('#my-alert').bind('closed', function () {
</pre> </pre>
<h4>Radio</h4> <h4>Radio</h4>
<p>Add data-toggle="buttons-radio" for radio style toggling on btn-group.</p> <p>Add <code>data-toggle="buttons-radio"</code> for radio style toggling on btn-group.</p>
<div class="bs-docs-example" style="padding-bottom: 24px;"> <div class="bs-docs-example" style="padding-bottom: 24px;">
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn btn-primary">Left</button> <button type="button" class="btn btn-primary">Left</button>
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
/* AFFIX PLUGIN DEFINITION /* AFFIX PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.affix
$.fn.affix = function (option) { $.fn.affix = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -85,6 +87,15 @@ ...@@ -85,6 +87,15 @@
} }
/* AFFIX NO CONFLICT
* ================= */
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
/* AFFIX DATA-API /* AFFIX DATA-API
* ============== */ * ============== */
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
/* ALERT PLUGIN DEFINITION /* ALERT PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.alert
$.fn.alert = function (option) { $.fn.alert = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -80,6 +82,15 @@ ...@@ -80,6 +82,15 @@
$.fn.alert.Constructor = Alert $.fn.alert.Constructor = Alert
/* ALERT NO CONFLICT
* ================= */
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
/* ALERT DATA-API /* ALERT DATA-API
* ============== */ * ============== */
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
/* BUTTON PLUGIN DEFINITION /* BUTTON PLUGIN DEFINITION
* ======================== */ * ======================== */
var old = $.fn.button
$.fn.button = function (option) { $.fn.button = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -82,6 +84,15 @@ ...@@ -82,6 +84,15 @@
$.fn.button.Constructor = Button $.fn.button.Constructor = Button
/* BUTTON NO CONFLICT
* ================== */
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
/* BUTTON DATA-API /* BUTTON DATA-API
* =============== */ * =============== */
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
var Carousel = function (element, options) { var Carousel = function (element, options) {
this.$element = $(element) this.$element = $(element)
this.options = options this.options = options
this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this)) .on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this)) .on('mouseleave', $.proxy(this.cycle, this))
...@@ -141,6 +140,8 @@ ...@@ -141,6 +140,8 @@
/* CAROUSEL PLUGIN DEFINITION /* CAROUSEL PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.carousel
$.fn.carousel = function (option) { $.fn.carousel = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -162,6 +163,14 @@ ...@@ -162,6 +163,14 @@
$.fn.carousel.Constructor = Carousel $.fn.carousel.Constructor = Carousel
/* CAROUSEL NO CONFLICT
* ==================== */
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
/* CAROUSEL DATA-API /* CAROUSEL DATA-API
* ================= */ * ================= */
......
...@@ -120,8 +120,10 @@ ...@@ -120,8 +120,10 @@
} }
/* COLLAPSIBLE PLUGIN DEFINITION /* COLLAPSE PLUGIN DEFINITION
* ============================== */ * ========================== */
var old = $.fn.collapse
$.fn.collapse = function (option) { $.fn.collapse = function (option) {
return this.each(function () { return this.each(function () {
...@@ -140,9 +142,18 @@ ...@@ -140,9 +142,18 @@
$.fn.collapse.Constructor = Collapse $.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) { $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href var $this = $(this), href
, target = $this.attr('data-target') , target = $this.attr('data-target')
......
...@@ -53,9 +53,10 @@ ...@@ -53,9 +53,10 @@
if (!isActive) { if (!isActive) {
$parent.toggleClass('open') $parent.toggleClass('open')
$this.focus()
} }
$this.focus()
return false return false
} }
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
if (!isActive || (isActive && e.keyCode == 27)) return $this.click() 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 if (!$items.length) return
...@@ -124,6 +125,8 @@ ...@@ -124,6 +125,8 @@
/* DROPDOWN PLUGIN DEFINITION /* DROPDOWN PLUGIN DEFINITION
* ========================== */ * ========================== */
var old = $.fn.dropdown
$.fn.dropdown = function (option) { $.fn.dropdown = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -136,6 +139,15 @@ ...@@ -136,6 +139,15 @@
$.fn.dropdown.Constructor = Dropdown $.fn.dropdown.Constructor = Dropdown
/* DROPDOWN NO CONFLICT
* ==================== */
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS /* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */ * =================================== */
......
...@@ -193,6 +193,8 @@ ...@@ -193,6 +193,8 @@
/* MODAL PLUGIN DEFINITION /* MODAL PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.modal
$.fn.modal = function (option) { $.fn.modal = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -213,6 +215,15 @@ ...@@ -213,6 +215,15 @@
$.fn.modal.Constructor = Modal $.fn.modal.Constructor = Modal
/* MODAL NO CONFLICT
* ================= */
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
/* MODAL DATA-API /* MODAL DATA-API
* ============== */ * ============== */
......
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
/* POPOVER PLUGIN DEFINITION /* POPOVER PLUGIN DEFINITION
* ======================= */ * ======================= */
var old = $.fn.popover
$.fn.popover = function (option) { $.fn.popover = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -100,4 +102,13 @@ ...@@ -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>' , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
}) })
/* POPOVER NO CONFLICT
* =================== */
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(window.jQuery); }(window.jQuery);
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href) , $href = /^#\w/.test(href) && $(href)
return ( $href return ( $href
&& $href.length && $href.length
&& [[ $href.position().top, href ]] ) || null && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
.each(function () { .each(function () {
...@@ -121,6 +121,8 @@ ...@@ -121,6 +121,8 @@
/* SCROLLSPY PLUGIN DEFINITION /* SCROLLSPY PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) { $.fn.scrollspy = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -138,6 +140,15 @@ ...@@ -138,6 +140,15 @@
} }
/* SCROLLSPY NO CONFLICT
* ===================== */
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
/* SCROLLSPY DATA-API /* SCROLLSPY DATA-API
* ================== */ * ================== */
......
...@@ -110,6 +110,8 @@ ...@@ -110,6 +110,8 @@
/* TAB PLUGIN DEFINITION /* TAB PLUGIN DEFINITION
* ===================== */ * ===================== */
var old = $.fn.tab
$.fn.tab = function ( option ) { $.fn.tab = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -122,6 +124,15 @@ ...@@ -122,6 +124,15 @@
$.fn.tab.Constructor = Tab $.fn.tab.Constructor = Tab
/* TAB NO CONFLICT
* =============== */
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
/* TAB DATA-API /* TAB DATA-API
* ============ */ * ============ */
......
...@@ -250,6 +250,8 @@ ...@@ -250,6 +250,8 @@
/* TOOLTIP PLUGIN DEFINITION /* TOOLTIP PLUGIN DEFINITION
* ========================= */ * ========================= */
var old = $.fn.tooltip
$.fn.tooltip = function ( option ) { $.fn.tooltip = function ( option ) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -273,4 +275,13 @@ ...@@ -273,4 +275,13 @@
, html: false , html: false
} }
/* TOOLTIP NO CONFLICT
* =================== */
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(window.jQuery); }(window.jQuery);
\ No newline at end of file
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
this.sorter = this.options.sorter || this.sorter this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater this.updater = this.options.updater || this.updater
this.$menu = $(this.options.menu).appendTo('body')
this.source = this.options.source this.source = this.options.source
this.$menu = $(this.options.menu)
this.shown = false this.shown = false
this.listen() this.listen()
} }
...@@ -56,16 +56,18 @@ ...@@ -56,16 +56,18 @@
} }
, show: function () { , show: function () {
var pos = $.extend({}, this.$element.offset(), { var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight height: this.$element[0].offsetHeight
}) })
this.$menu.css({ this.$menu
top: pos.top + pos.height .insertAfter(this.$element)
, left: pos.left .css({
}) top: pos.top + pos.height
, left: pos.left
})
.show()
this.$menu.show()
this.shown = true this.shown = true
return this return this
} }
...@@ -217,7 +219,7 @@ ...@@ -217,7 +219,7 @@
} }
, keydown: function (e) { , 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) this.move(e)
} }
...@@ -276,6 +278,8 @@ ...@@ -276,6 +278,8 @@
/* TYPEAHEAD PLUGIN DEFINITION /* TYPEAHEAD PLUGIN DEFINITION
* =========================== */ * =========================== */
var old = $.fn.typeahead
$.fn.typeahead = function (option) { $.fn.typeahead = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
...@@ -297,7 +301,16 @@ ...@@ -297,7 +301,16 @@
$.fn.typeahead.Constructor = Typeahead $.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) { $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-affix") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).affix, 'affix method is defined') ok($(document.body).affix, 'affix method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-alerts") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).alert, 'alert method is defined') ok($(document.body).alert, 'alert method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-buttons") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).button, 'button method is defined') ok($(document.body).button, 'button method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-carousel") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).carousel, 'carousel method is defined') ok($(document.body).carousel, 'carousel method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-collapse") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).collapse, 'collapse method is defined') ok($(document.body).collapse, 'collapse method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-dropdowns") 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 () { test("should be defined on jquery object", function () {
ok($(document.body).dropdown, 'dropdown method is defined') ok($(document.body).dropdown, 'dropdown method is defined')
}) })
...@@ -104,7 +110,7 @@ $(function () { ...@@ -104,7 +110,7 @@ $(function () {
}) })
test("should remove open class if body clicked, with multiple drop downs", function () { test("should remove open class if body clicked, with multiple drop downs", function () {
var dropdownHTML = var dropdownHTML =
'<ul class="nav">' '<ul class="nav">'
+ ' <li><a href="#menu1">Menu 1</a></li>' + ' <li><a href="#menu1">Menu 1</a></li>'
+ ' <li class="dropdown" id="testmenu">' + ' <li class="dropdown" id="testmenu">'
...@@ -126,7 +132,7 @@ $(function () { ...@@ -126,7 +132,7 @@ $(function () {
, last = dropdowns.last() , last = dropdowns.last()
ok(dropdowns.length == 2, "Should be two dropdowns") ok(dropdowns.length == 2, "Should be two dropdowns")
first.click() first.click()
ok(first.parents('.open').length == 1, 'open class added on click') ok(first.parents('.open').length == 1, 'open class added on click')
ok($('#qunit-fixture .open').length == 1, 'only one object is open') ok($('#qunit-fixture .open').length == 1, 'only one object is open')
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-modal") module("bootstrap-modal")
test("should provide no conflict", function () {
var modal = $.fn.modal.noConflict()
ok(!$.fn.modal, 'modal was set back to undefined (org value)')
$.fn.modal = modal
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
var div = $("<div id='modal-test'></div>") var div = $("<div id='modal-test'></div>")
ok(div.modal, 'modal method is defined') ok(div.modal, 'modal method is defined')
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-popover") module("bootstrap-popover")
test("should provide no conflict", function () {
var popover = $.fn.popover.noConflict()
ok(!$.fn.popover, 'popover was set back to undefined (org value)')
$.fn.popover = popover
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
var div = $('<div></div>') var div = $('<div></div>')
ok(div.popover, 'popover method is defined') ok(div.popover, 'popover method is defined')
...@@ -70,7 +76,7 @@ $(function () { ...@@ -70,7 +76,7 @@ $(function () {
ok(!$('.popover').length, 'popover was removed') ok(!$('.popover').length, 'popover was removed')
$('#qunit-fixture').empty() $('#qunit-fixture').empty()
}) })
test("should respect custom classes", function() { test("should respect custom classes", function() {
$.support.transition = false $.support.transition = false
var popover = $('<a href="#">@fat</a>') var popover = $('<a href="#">@fat</a>')
...@@ -80,7 +86,7 @@ $(function () { ...@@ -80,7 +86,7 @@ $(function () {
, content: 'Test' , content: 'Test'
, template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>' , template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
}) })
popover.popover('show') popover.popover('show')
ok($('.popover').length, 'popover was inserted') ok($('.popover').length, 'popover was inserted')
...@@ -103,5 +109,5 @@ $(function () { ...@@ -103,5 +109,5 @@ $(function () {
ok($._data(popover[0],'events').click[0].namespace == 'foo', 'popover still has click.foo') ok($._data(popover[0],'events').click[0].namespace == 'foo', 'popover still has click.foo')
ok(!$._data(popover[0], 'events').mouseover && !$._data(popover[0], 'events').mouseout, 'popover does not have any events') ok(!$._data(popover[0], 'events').mouseover && !$._data(popover[0], 'events').mouseout, 'popover does not have any events')
}) })
}) })
\ No newline at end of file
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-scrollspy") module("bootstrap-scrollspy")
test("should provide no conflict", function () {
var scrollspy = $.fn.scrollspy.noConflict()
ok(!$.fn.scrollspy, 'scrollspy was set back to undefined (org value)')
$.fn.scrollspy = scrollspy
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
ok($(document.body).scrollspy, 'scrollspy method is defined') ok($(document.body).scrollspy, 'scrollspy method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-tabs") module("bootstrap-tabs")
test("should provide no conflict", function () {
var tab = $.fn.tab.noConflict()
ok(!$.fn.tab, 'tab was set back to undefined (org value)')
$.fn.tab = tab
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
ok($(document.body).tab, 'tabs method is defined') ok($(document.body).tab, 'tabs method is defined')
}) })
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-tooltip") module("bootstrap-tooltip")
test("should provide no conflict", function () {
var tooltip = $.fn.tooltip.noConflict()
ok(!$.fn.tooltip, 'tooltip was set back to undefined (org value)')
$.fn.tooltip = tooltip
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
var div = $("<div></div>") var div = $("<div></div>")
ok(div.tooltip, 'popover method is defined') ok(div.tooltip, 'popover method is defined')
......
...@@ -2,6 +2,12 @@ $(function () { ...@@ -2,6 +2,12 @@ $(function () {
module("bootstrap-typeahead") module("bootstrap-typeahead")
test("should provide no conflict", function () {
var typeahead = $.fn.typeahead.noConflict()
ok(!$.fn.typeahead, 'typeahead was set back to undefined (org value)')
$.fn.typeahead = typeahead
})
test("should be defined on jquery object", function () { test("should be defined on jquery object", function () {
ok($(document.body).typeahead, 'alert method is defined') ok($(document.body).typeahead, 'alert method is defined')
}) })
...@@ -32,7 +38,9 @@ $(function () { ...@@ -32,7 +38,9 @@ $(function () {
}) })
test("should show menu when query entered", function () { test("should show menu when query entered", function () {
var $input = $('<input />').typeahead({ var $input = $('<input />')
.appendTo('body')
.typeahead({
source: ['aa', 'ab', 'ac'] source: ['aa', 'ab', 'ac']
}) })
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
...@@ -44,6 +52,7 @@ $(function () { ...@@ -44,6 +52,7 @@ $(function () {
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu') equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
equals(typeahead.$menu.find('.active').length, 1, 'one item is active') equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
...@@ -52,7 +61,7 @@ $(function () { ...@@ -52,7 +61,7 @@ $(function () {
source: function () { source: function () {
return ['aa', 'ab', 'ac'] return ['aa', 'ab', 'ac']
} }
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('a') $input.val('a')
...@@ -62,6 +71,7 @@ $(function () { ...@@ -62,6 +71,7 @@ $(function () {
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu') equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
equals(typeahead.$menu.find('.active').length, 1, 'one item is active') equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
...@@ -70,7 +80,7 @@ $(function () { ...@@ -70,7 +80,7 @@ $(function () {
source: function (query, process) { source: function (query, process) {
process(['aa', 'ab', 'ac']) process(['aa', 'ab', 'ac'])
} }
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('a') $input.val('a')
...@@ -80,13 +90,14 @@ $(function () { ...@@ -80,13 +90,14 @@ $(function () {
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu') equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
equals(typeahead.$menu.find('.active').length, 1, 'one item is active') equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
test("should not explode when regex chars are entered", function () { test("should not explode when regex chars are entered", function () {
var $input = $('<input />').typeahead({ var $input = $('<input />').typeahead({
source: ['aa', 'ab', 'ac', 'mdo*', 'fat+'] source: ['aa', 'ab', 'ac', 'mdo*', 'fat+']
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('+') $input.val('+')
...@@ -96,6 +107,7 @@ $(function () { ...@@ -96,6 +107,7 @@ $(function () {
equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu') equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu')
equals(typeahead.$menu.find('.active').length, 1, 'one item is active') equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
...@@ -103,7 +115,7 @@ $(function () { ...@@ -103,7 +115,7 @@ $(function () {
stop() stop()
var $input = $('<input />').typeahead({ var $input = $('<input />').typeahead({
source: ['aa', 'ab', 'ac'] source: ['aa', 'ab', 'ac']
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('a') $input.val('a')
...@@ -120,13 +132,14 @@ $(function () { ...@@ -120,13 +132,14 @@ $(function () {
start() start()
}, 200) }, 200)
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
test("should set next item when down arrow is pressed", function () { test("should set next item when down arrow is pressed", function () {
var $input = $('<input />').typeahead({ var $input = $('<input />').typeahead({
source: ['aa', 'ab', 'ac'] source: ['aa', 'ab', 'ac']
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('a') $input.val('a')
...@@ -137,21 +150,38 @@ $(function () { ...@@ -137,21 +150,38 @@ $(function () {
equals(typeahead.$menu.find('.active').length, 1, 'one item is active') equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active") ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
// simulate entire key pressing event
$input.trigger({ $input.trigger({
type: 'keydown' type: 'keydown'
, keyCode: 40 , keyCode: 40
}) })
.trigger({
type: 'keypress'
, keyCode: 40
})
.trigger({
type: 'keyup'
, keyCode: 40
})
ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active") ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
$input.trigger({ $input.trigger({
type: 'keydown' type: 'keydown'
, keyCode: 38 , keyCode: 38
}) })
.trigger({
type: 'keypress'
, keyCode: 38
})
.trigger({
type: 'keyup'
, keyCode: 38
})
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active") ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
...@@ -159,7 +189,7 @@ $(function () { ...@@ -159,7 +189,7 @@ $(function () {
test("should set input value to selected item", function () { test("should set input value to selected item", function () {
var $input = $('<input />').typeahead({ var $input = $('<input />').typeahead({
source: ['aa', 'ab', 'ac'] source: ['aa', 'ab', 'ac']
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
, changed = false , changed = false
...@@ -174,6 +204,7 @@ $(function () { ...@@ -174,6 +204,7 @@ $(function () {
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden') ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
ok(changed, 'a change event was fired') ok(changed, 'a change event was fired')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
...@@ -181,7 +212,7 @@ $(function () { ...@@ -181,7 +212,7 @@ $(function () {
var $input = $('<input />').typeahead({ var $input = $('<input />').typeahead({
source: ['aaaa', 'aaab', 'aaac'], source: ['aaaa', 'aaab', 'aaac'],
minLength: 3 minLength: 3
}) }).appendTo('body')
, typeahead = $input.data('typeahead') , typeahead = $input.data('typeahead')
$input.val('aa') $input.val('aa')
...@@ -194,6 +225,7 @@ $(function () { ...@@ -194,6 +225,7 @@ $(function () {
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu') equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
$input.remove()
typeahead.$menu.remove() typeahead.$menu.remove()
}) })
}) })
\ No newline at end of file
...@@ -74,6 +74,10 @@ ...@@ -74,6 +74,10 @@
font-size: @font-size-small; font-size: @font-size-small;
border-radius: @border-radius-small; border-radius: @border-radius-small;
} }
.btn-mini [class^="icon-"],
.btn-mini [class*=" icon-"] {
margin-top: -1px;
}
// Mini // Mini
.btn-mini { .btn-mini {
......
...@@ -47,6 +47,8 @@ pre { ...@@ -47,6 +47,8 @@ pre {
code { code {
padding: 0; padding: 0;
color: inherit; color: inherit;
white-space: pre;
white-space: pre-wrap;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
} }
......
...@@ -47,6 +47,11 @@ table { ...@@ -47,6 +47,11 @@ table {
tbody + tbody { tbody + tbody {
border-top: 2px solid @table-border; border-top: 2px solid @table-border;
} }
// Nesting
.table {
background-color: @body-background;
}
} }
...@@ -88,35 +93,34 @@ table { ...@@ -88,35 +93,34 @@ table {
border-top: 0; border-top: 0;
} }
// For first th or td in the first row in the first thead or tbody // For first th or td in the first row in the first thead or tbody
thead:first-child tr:first-child th:first-child, thead:first-child tr:first-child > th:first-child,
tbody:first-child tr:first-child td:first-child { tbody:first-child tr:first-child > td:first-child {
border-top-left-radius: @border-radius-base; border-top-left-radius: @border-radius-base;
} }
thead:first-child tr:first-child th:last-child, thead:first-child tr:first-child > th:last-child,
tbody:first-child tr:first-child td:last-child { tbody:first-child tr:first-child > td:last-child {
border-top-right-radius: @border-radius-base; border-top-right-radius: @border-radius-base;
} }
// For first th or td in the last row in the last thead or tbody // For first th or td in the last row in the last thead or tbody
thead:last-child tr:last-child th:first-child, thead:last-child tr:last-child > th:first-child,
tbody:last-child tr:last-child td:first-child, tbody:last-child tr:last-child > td:first-child,
tfoot:last-child tr:last-child td:first-child { tfoot:last-child tr:last-child > td:first-child {
border-bottom-left-radius: @border-radius-base; border-bottom-left-radius: @border-radius-base;
} }
thead:last-child tr:last-child th:last-child, thead:last-child tr:last-child > th:last-child,
tbody:last-child tr:last-child td:last-child, tbody:last-child tr:last-child > td:last-child,
tfoot:last-child tr:last-child td:last-child { tfoot:last-child tr:last-child > td:last-child {
border-bottom-right-radius: @border-radius-base; border-bottom-right-radius: @border-radius-base;
} }
// Clear border-radius for first and last td in the last row in the last tbody for table with tfoot // Clear border-radius for first and last td in the last row in the last tbody for table with tfoot
tfoot + tbody:last-child tr:last-child td:first-child { tfoot + tbody:last-child tr:last-child > td:first-child {
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
tfoot + tbody:last-child tr:last-child td:last-child { tfoot + tbody:last-child tr:last-child > td:last-child {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
// Special fixes to round the left border on the first td/th // Special fixes to round the left border on the first td/th
caption + thead tr:first-child th:first-child, caption + thead tr:first-child th:first-child,
caption + tbody tr:first-child td:first-child, caption + tbody tr:first-child td:first-child,
...@@ -141,8 +145,8 @@ table { ...@@ -141,8 +145,8 @@ table {
// Default zebra-stripe styles (alternating gray and transparent backgrounds) // Default zebra-stripe styles (alternating gray and transparent backgrounds)
.table-striped { .table-striped {
tbody { tbody {
tr:nth-child(odd) td, > tr:nth-child(odd) > td,
tr:nth-child(odd) th { > tr:nth-child(odd) > th {
background-color: @table-background-accent; background-color: @table-background-accent;
} }
} }
......
...@@ -467,7 +467,54 @@ ...@@ -467,7 +467,54 @@
</div> </div>
</div><!--/row--> </div><!--/row-->
<h4>Nesting and striping</h4>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Test</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Test</th>
<th>Test</th>
</tr>
</thead>
<tbody>
<tr>
<td>
test
</td>
<td>
test
</td>
</tr>
<tr>
<td>
test
</td>
<td>
test
</td>
</tr>
<tr>
<td>
test
</td>
<td>
test
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!-- Forms <!-- Forms
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment