aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-01-28 11:22:07 -0800
committerMark Otto <[email protected]>2012-01-28 11:22:07 -0800
commit245276825924acd0cfe5f4fd57b0f8b9970b64c3 (patch)
tree5d803eec9195de7e19dac304f05eddd1895bc914
parent28ba9d69c82895bbd9a1d66cea855119f4aba349 (diff)
parentc2c02d104c5e5a96330cf00a727d62687d863e02 (diff)
downloadbootstrap-245276825924acd0cfe5f4fd57b0f8b9970b64c3.tar.xz
bootstrap-245276825924acd0cfe5f4fd57b0f8b9970b64c3.zip
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
-rw-r--r--docs/assets/css/bootstrap.css2
-rw-r--r--docs/assets/js/application.js6
-rw-r--r--js/bootstrap-alert.js10
-rw-r--r--js/bootstrap-carousel.js4
-rw-r--r--js/bootstrap-collapse.js6
-rw-r--r--js/bootstrap-dropdown.js19
-rw-r--r--js/bootstrap-modal.js4
-rw-r--r--js/bootstrap-scrollspy.js3
-rw-r--r--js/bootstrap-tab.js13
-rw-r--r--js/bootstrap-tooltip.js1
-rw-r--r--js/tests/unit/bootstrap-popover.js2
-rw-r--r--js/tests/unit/bootstrap-tab.js1
-rw-r--r--js/tests/unit/bootstrap-transition.js2
13 files changed, 44 insertions, 29 deletions
diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css
index bc4961b05..5265b14df 100644
--- a/docs/assets/css/bootstrap.css
+++ b/docs/assets/css/bootstrap.css
@@ -1983,7 +1983,7 @@ table .span12 {
.navbar-search .search-query :-moz-placeholder {
color: #eeeeee;
}
-.navbar-search .search-query ::-webkit-input-placeholder {
+.navbar-search .search-query::-webkit-input-placeholder {
color: #eeeeee;
}
.navbar-search .search-query:hover {
diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js
index f4edd6861..8fd672bb3 100644
--- a/docs/assets/js/application.js
+++ b/docs/assets/js/application.js
@@ -14,12 +14,6 @@
// make code pretty
window.prettyPrint && prettyPrint()
- // table sort example
- if ($.fn.tablesorter) {
- $("#sortTableExample").tablesorter({ sortList: [[1,0]] })
- $(".tablesorter-example").tablesorter({ sortList: [[1,0]] })
- }
-
// add-ons
$('.add-on :checkbox').on('click', function () {
var $this = $(this)
diff --git a/js/bootstrap-alert.js b/js/bootstrap-alert.js
index 2df64c6e1..4a65b135a 100644
--- a/js/bootstrap-alert.js
+++ b/js/bootstrap-alert.js
@@ -36,9 +36,15 @@
, close: function ( e ) {
var $this = $(this)
- , selector = $this.attr('data-target') || $this.attr('href')
- , $parent = $(selector)
+ , selector = $this.attr('data-target')
+ , $parent
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
$parent.trigger('close')
e && e.preventDefault()
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js
index 47d832c82..2f47edb8d 100644
--- a/js/bootstrap-carousel.js
+++ b/js/bootstrap-carousel.js
@@ -143,8 +143,8 @@
$(function () {
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
- var $this = $(this)
- , $target = $($this.attr('data-target') || $this.attr('href'))
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
$target.carousel(options)
e.preventDefault()
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index e33dadedf..ee36840d2 100644
--- a/js/bootstrap-collapse.js
+++ b/js/bootstrap-collapse.js
@@ -124,8 +124,10 @@
$(function () {
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
- var $this = $(this)
- , target = $this.attr('data-target') || e.preventDefault() || $this.attr('href')
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
, option = $(target).data('collapse') ? 'toggle' : $this.data()
$(target).collapse(option)
})
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index 1ae317b44..48d3ce0f8 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -27,7 +27,10 @@
var toggle = '[data-toggle="dropdown"]'
, Dropdown = function ( element ) {
- $(element).bind('click', this.toggle)
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
+ $('html').on('click.dropdown.data-api', function () {
+ $el.parent().removeClass('open')
+ })
}
Dropdown.prototype = {
@@ -36,15 +39,21 @@
, toggle: function ( e ) {
var $this = $(this)
- , selector = $this.attr('data-target') || $this.attr('href')
- , $parent = $(selector)
+ , selector = $this.attr('data-target')
+ , $parent
, isActive
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
$parent.length || ($parent = $this.parent())
+
isActive = $parent.hasClass('open')
clearMenus()
-
!isActive && $parent.toggleClass('open')
return false
@@ -76,7 +85,7 @@
* =================================== */
$(function () {
- $(window).on('click.dropdown.data-api', clearMenus)
+ $('html').on('click.dropdown.data-api', clearMenus)
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index eea1938d0..91daa8af6 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -193,8 +193,8 @@
$(function () {
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
- var $this = $(this)
- , $target = $($this.attr('data-target') || $this.attr('href'))
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
e.preventDefault()
diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js
index dcb52456e..e8bd0715c 100644
--- a/js/bootstrap-scrollspy.js
+++ b/js/bootstrap-scrollspy.js
@@ -27,10 +27,11 @@
function ScrollSpy( element, options) {
var process = $.proxy(this.process, this)
, $element = $(element).is('body') ? $(window) : $(element)
+ , href
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
this.selector = (this.options.target
- || $(element).attr('href')
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.$body = $('body').on('click.scroll.data-api', this.selector, process)
this.refresh()
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index 95698d23e..f19db5da1 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -36,9 +36,14 @@
, show: function () {
var $this = this.element
, $ul = $this.closest('ul:not(.dropdown-menu)')
- , href = $this.attr('data-target') || $this.attr('href')
+ , selector = $this.attr('data-target')
, previous
- , $href
+ , $target
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
if ( $this.parent('li').hasClass('active') ) return
@@ -49,10 +54,10 @@
, relatedTarget: previous
})
- $href = $(href)
+ $target = $(selector)
this.activate($this.parent('li'), $ul)
- this.activate($href, $href.parent(), function () {
+ this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown'
, relatedTarget: previous
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js
index 65f8895aa..67fca5e14 100644
--- a/js/bootstrap-tooltip.js
+++ b/js/bootstrap-tooltip.js
@@ -145,7 +145,6 @@
break
}
- debugger
if (this.options['z-index']) tp['z-index'] = this.options['z-index']
$tip
diff --git a/js/tests/unit/bootstrap-popover.js b/js/tests/unit/bootstrap-popover.js
index 462db8b3e..08cabae42 100644
--- a/js/tests/unit/bootstrap-popover.js
+++ b/js/tests/unit/bootstrap-popover.js
@@ -82,7 +82,7 @@ $(function () {
})
popover.popover('show')
- console.log(popover)
+
ok($('.popover').length, 'popover was inserted')
ok($('.popover').hasClass('foobar'), 'custom class is present')
diff --git a/js/tests/unit/bootstrap-tab.js b/js/tests/unit/bootstrap-tab.js
index f32649078..18f490fa5 100644
--- a/js/tests/unit/bootstrap-tab.js
+++ b/js/tests/unit/bootstrap-tab.js
@@ -17,7 +17,6 @@ $(function () {
+ '<li><a href="#profile">Profile</a></li>'
+ '</ul>'
-
$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
$(tabsHTML).find('li:last a').tab('show')
diff --git a/js/tests/unit/bootstrap-transition.js b/js/tests/unit/bootstrap-transition.js
index ff4a0f0c3..3f28d2676 100644
--- a/js/tests/unit/bootstrap-transition.js
+++ b/js/tests/unit/bootstrap-transition.js
@@ -7,7 +7,7 @@ $(function () {
})
test("should provide an end object", function () {
- ok($.support.transition.end, 'end string is defined')
+ ok($.support.transition ? $.support.transition.end : true, 'end string is defined')
})
}) \ No newline at end of file