Commit e555f38a authored by Mark Otto's avatar Mark Otto

Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip

Conflicts:
	docs/less.html
parents 6ab56051 5d3175e8
...@@ -119,7 +119,7 @@ $(function(){ ...@@ -119,7 +119,7 @@ $(function(){
// fix sub nav playa // fix sub nav playa
var $win = $(window) var $win = $(window)
, $nav = $('.subnav') , $nav = $('.subnav')
, navTop = $('.subnav').offset().top - 40 , navTop = $('.subnav').length && $('.subnav').offset().top - 40
, isFixed = 0 , isFixed = 0
processScroll() processScroll()
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
function ScrollSpy( element, options) { function ScrollSpy( element, options) {
var process = $.proxy(this.process, this) var process = $.proxy(this.process, this)
, $element = $(element).is('body') ? $(window) : $(element)
this.options = $.extend({}, $.fn.scrollspy.defaults, options) this.options = $.extend({}, $.fn.scrollspy.defaults, options)
this.$scrollElement = $(element).on('scroll.scroll.data-api', process) this.$scrollElement = $element.on('scroll.scroll.data-api', process)
this.selector = (this.$scrollElement.attr('data-target') this.selector = (this.options.target
|| this.$scrollElement.attr('href') || $(element).attr('href')
|| '') + ' .nav li > a' || '') + ' .nav li > a'
this.$body = $('body').on('click.scroll.data-api', this.selector, process) this.$body = $('body').on('click.scroll.data-api', this.selector, process)
this.refresh() this.refresh()
...@@ -111,11 +112,13 @@ ...@@ -111,11 +112,13 @@
/* SCROLLSPY DATA-API /* SCROLLSPY DATA-API
* ============== */ * ================== */
$(function () { $(function () {
var $spy = $('[data-spy="scroll"]') $('[data-spy="scroll"]').each(function () {
$spy.scrollspy($spy.data()) var $spy = $(this)
$spy.scrollspy($spy.data())
})
}) })
}( window.jQuery ) }( window.jQuery )
\ No newline at end of file
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