From 160b60ca4a44de9f32d7276014b45379b0ffd60d Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:12:40 -0500 Subject: [PATCH 1/7] Removing IE7 support for stripping selectors --- js/alert.js | 1 - js/tab.js | 1 - 2 files changed, 2 deletions(-) diff --git a/js/alert.js b/js/alert.js index 73372e4f1915..49e81d4eb63e 100644 --- a/js/alert.js +++ b/js/alert.js @@ -34,7 +34,6 @@ if (!selector) { selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = $(selector) diff --git a/js/tab.js b/js/tab.js index 7aff6130aec1..48e46fdf2a2d 100644 --- a/js/tab.js +++ b/js/tab.js @@ -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 From 63cf61b9ee3fdb151f62bc4bd3e3da5a8ec84bff Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:17:32 -0500 Subject: [PATCH 2/7] Removing more IE7 support --- js/modal.js | 2 +- js/scrollspy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/modal.js b/js/modal.js index b5b56016cd34..f13a14fb09b4 100644 --- a/js/modal.js +++ b/js/modal.js @@ -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() diff --git a/js/scrollspy.js b/js/scrollspy.js index c88eaad99308..5be9acb3c9a6 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -32,7 +32,7 @@ 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 + || (href = $(element).attr('href')) || '') + ' .nav li > a' this.offsets = $([]) this.targets = $([]) From b8cd0903d4059638b32f3a21774c9ad360b6d2e3 Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:20:08 -0500 Subject: [PATCH 3/7] Removing support for IE7 in carousel.js --- js/carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/carousel.js b/js/carousel.js index cf7baf2a73e2..8f53506fc595 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -193,7 +193,7 @@ $(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 $target = $($this.attr('data-target') || (href = $this.attr('href'))) var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false From 303232b4506d2ce6b8145d258d53d08abfcb54b0 Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:21:22 -0500 Subject: [PATCH 4/7] Removing support for IE7 in collapse.js --- js/collapse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/collapse.js b/js/collapse.js index beb0477259bc..15bc36425fc5 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -161,7 +161,7 @@ var $this = $(this), href var target = $this.attr('data-target') || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + || (href = $this.attr('href')) var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() From e12c3d2502121e42fb3ce2b55ae8219698e3731d Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:29:32 -0500 Subject: [PATCH 5/7] Removing support for IE7 in dropdown.js --- js/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/dropdown.js b/js/dropdown.js index e45d51c2d95d..7a26f8dfb670 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -106,7 +106,7 @@ if (!selector) { selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + selector = /#/.test(selector) && selector } var $parent = selector && $(selector) From eeecf3ea48dff7e37a0fea5d618258c7a37c504d Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Sun, 29 Sep 2013 00:59:58 -0500 Subject: [PATCH 6/7] Don't create the href variable when it's only used once --- js/carousel.js | 4 ++-- js/collapse.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/carousel.js b/js/carousel.js index 8f53506fc595..70ae31f2fbde 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -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'))) + 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 diff --git a/js/collapse.js b/js/collapse.js index 15bc36425fc5..b0469c8eb885 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -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')) + || $this.attr('href') var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() From ca05ad60a2d13f1caca20f9faef58509a5153dc0 Mon Sep 17 00:00:00 2001 From: Dan Silver Date: Tue, 15 Oct 2013 11:30:36 -0500 Subject: [PATCH 7/7] Removed extra href var --- js/scrollspy.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/scrollspy.js b/js/scrollspy.js index 5be9acb3c9a6..c9349936fcc6 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -24,7 +24,6 @@ // ========================== function ScrollSpy(element, options) { - var href var process = $.proxy(this.process, this) this.$element = $(element).is('body') ? $(window) : $(element) @@ -32,7 +31,7 @@ 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')) + || $(element).attr('href') || '') + ' .nav li > a' this.offsets = $([]) this.targets = $([])