Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = $(selector)
Expand Down
4 changes: 2 additions & 2 deletions js/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@
// =================

$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var $this = $(this)
var $target = $($this.attr('data-target') || $this.attr('href'))
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
Expand Down
4 changes: 2 additions & 2 deletions js/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@
// =================

$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
var $this = $(this)
var target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|| $this.attr('href')
var $target = $(target)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
Expand Down
2 changes: 1 addition & 1 deletion js/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

if (!selector) {
selector = $this.attr('href')
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
selector = /#/.test(selector) && selector

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line should just be eliminated entirely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I removed this line, it fails the test "should test if element has a # before assuming it's a selector". Should I remove the test as well or leave both of them as is?

}

var $parent = selector && $(selector)
Expand Down
2 changes: 1 addition & 1 deletion js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var $target = $($this.attr('data-target') || href)
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())

e.preventDefault()
Expand Down
3 changes: 1 addition & 2 deletions js/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
// ==========================

function ScrollSpy(element, options) {
var href
var process = $.proxy(this.process, this)

this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body')
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| $(element).attr('href')
|| '') + ' .nav li > a'
this.offsets = $([])
this.targets = $([])
Expand Down
1 change: 0 additions & 1 deletion js/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}

if ($this.parent('li').hasClass('active')) return
Expand Down