From 45276521778c9843c3d308f7fcda4168a75f4825 Mon Sep 17 00:00:00 2001 From: Patrick Yeo Date: Fri, 8 Sep 2017 14:53:15 -0700 Subject: Collapse.js preventDefault if `[data-toggle="collapse"]` is an anchor tag --- js/src/collapse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index acc959d40..bf9c990ec 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -363,7 +363,7 @@ const Collapse = (() => { $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { // preventDefault only for elements (which change the URL) not inside the collapsible element - if (event.target.tagName === 'A' && !$.contains(this, event.target)) { + if (event.currentTarget.tagName === 'A') { event.preventDefault() } -- cgit v1.2.3 From d5890cb82f4dcd2b5b8e2e6d4d7bebd1026e2228 Mon Sep 17 00:00:00 2001 From: vsn4ik Date: Mon, 11 Sep 2017 22:44:42 +0300 Subject: Remove not necessary condition in tooltip.js --- js/src/tooltip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/src') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 5dc28ab7e..ca7e52b14 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -622,18 +622,18 @@ const Tooltip = (() => { config ) - if (config.delay && typeof config.delay === 'number') { + if (typeof config.delay === 'number') { config.delay = { show : config.delay, hide : config.delay } } - if (config.title && typeof config.title === 'number') { + if (typeof config.title === 'number') { config.title = config.title.toString() } - if (config.content && typeof config.content === 'number') { + if (typeof config.content === 'number') { config.content = config.content.toString() } -- cgit v1.2.3 From 6c70c70f637267ca109f44ff63f564892ece42bf Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 17 Sep 2017 04:30:37 -0300 Subject: fix(scrollspy): Spying on nested navs fails to activate for .nav-link's inside nav-item's (#23967) * fix(scrollspy): Handle nested navs when nav-link inside nav-item * [scrolspy] Find only child .nav-link's inside .nav-item * [scrollspyt] Add tests for nested navs with nav-link inside nav-item * fix troy-o's in test --- js/src/scrollspy.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/src') diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 70067c0b3..e8f0d3101 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -54,6 +54,7 @@ const ScrollSpy = (() => { ACTIVE : '.active', NAV_LIST_GROUP : '.nav, .list-group', NAV_LINKS : '.nav-link', + NAV_ITEMS : '.nav-item', LIST_ITEMS : '.list-group-item', DROPDOWN : '.dropdown', DROPDOWN_ITEMS : '.dropdown-item', @@ -264,6 +265,8 @@ const ScrollSpy = (() => { // Set triggered links parents as active // With both
    and