From 5a38a5775f8a3c58c09df0a0f3afc058c820c238 Mon Sep 17 00:00:00 2001 From: Arnold Daniels Date: Tue, 22 Oct 2013 13:31:23 +0200 Subject: Scrollspy acting up when targets are hidden If elements are hidden using `display: none;` which are targets mapped by scrollspy, the plugin might select an incorrect or no menu item. Checking if the target is visible solved this. --- js/scrollspy.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js') diff --git a/js/scrollspy.js b/js/scrollspy.js index 10f95f249..08319dd18 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -62,6 +62,7 @@ return ($href && $href.length + && $href.is(':visible') && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null }) .sort(function (a, b) { return a[0] - b[0] }) -- cgit v1.2.3 From ed5dbf1b2b8187b6939ab10d75573118d346f970 Mon Sep 17 00:00:00 2001 From: Chris Ziogas Date: Mon, 4 Nov 2013 19:09:48 +0200 Subject: Update affix properly on scrollspy speedy scroll to top of page #11310 Fix scrollspy.js so as affix is updated properly when user scrolls fast to top of page. A fix for issue #11310. --- js/scrollspy.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js') diff --git a/js/scrollspy.js b/js/scrollspy.js index 19ed6fcd5..cc52e153a 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -84,6 +84,10 @@ return activeTarget != (i = targets.last()[0]) && this.activate(i) } + if (activeTarget && scrollTop <= offsets[0]) { + return activeTarget != (i = targets.first()[0]) && this.activate(i) + } + for (i = offsets.length; i--;) { activeTarget != targets[i] && scrollTop >= offsets[i] -- cgit v1.2.3 From bbe551044c00bf89fdc9bdfac809fead62767bdb Mon Sep 17 00:00:00 2001 From: Scott Plumlee Date: Tue, 10 Dec 2013 11:17:43 -0500 Subject: Allow listbox AIRA role on dropdown component. --- js/dropdown.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/dropdown.js b/js/dropdown.js index 3f71c7569..0a210ef35 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -77,7 +77,8 @@ return $this.click() } - var $items = $('[role=menu] li:not(.divider):visible a', $parent) + var desc = ' li:not(.divider):visible a' + var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) if (!$items.length) return @@ -149,6 +150,6 @@ .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]' , Dropdown.prototype.keydown) }(jQuery); -- cgit v1.2.3 From 5bf13914e49942409c0b21aeaf2ed756c41bd498 Mon Sep 17 00:00:00 2001 From: fat Date: Sat, 28 Dec 2013 20:59:45 -0800 Subject: fixes #10658 jQuery Popover content loses bound events on second setContent call. --- js/popover.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/popover.js b/js/popover.js index 1e8104c4f..3fd29802d 100644 --- a/js/popover.js +++ b/js/popover.js @@ -43,7 +43,9 @@ var content = this.getContent() $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) - $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) + $tip.find('.popover-content')[ // we use append for html objects to maintain js events + this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' + ](content) $tip.removeClass('fade top bottom left right in') -- cgit v1.2.3 From ce4a2e435268a2eeb5578cbb4ff70bfaaed0eef9 Mon Sep 17 00:00:00 2001 From: fat Date: Sun, 29 Dec 2013 17:53:59 -0800 Subject: fixes #11288 - Vertical scroll position of modal saves between openings --- js/modal.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/modal.js b/js/modal.js index 5fd53b849..856ea7cd8 100644 --- a/js/modal.js +++ b/js/modal.js @@ -18,9 +18,13 @@ this.$backdrop = this.isShown = null - if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () { - this.$element.trigger('loaded.bs.modal') - }, this)) + if (this.options.remote) { + this.$element + .find('.modal-content') + .load(this.options.remote, $.proxy(function () { + this.$element.trigger('loaded.bs.modal') + }, this)) + } } Modal.DEFAULTS = { @@ -54,7 +58,9 @@ that.$element.appendTo(document.body) // don't move modals dom position } - that.$element.show() + that.$element + .show() + .scrollTop(0) if (transition) { that.$element[0].offsetWidth // force reflow -- cgit v1.2.3 From 76f0d0ff32b6946dbd8c667a517a4deb69ad8890 Mon Sep 17 00:00:00 2001 From: fat Date: Sun, 29 Dec 2013 18:57:22 -0800 Subject: fixes #11373 - adds related target to dropdown events --- js/dropdown.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/dropdown.js b/js/dropdown.js index 48752fda5..b19b255ae 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -34,13 +34,14 @@ $('