From 099486f294e79bfe1f2c6b431ee4696237f616cd Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 7 Mar 2017 10:46:08 +0100 Subject: Detach accordions from .card --- js/src/collapse.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index 28c4493cc..e2c9efe11 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -57,7 +57,8 @@ const Collapse = (($) => { const Selector = { ACTIVES : '.card > .show, .card > .collapsing', - DATA_TOGGLE : '[data-toggle="collapse"]' + DATA_TOGGLE : '[data-toggle="collapse"]', + DATA_CHILDREN : 'data-children' } @@ -84,6 +85,14 @@ const Collapse = (($) => { this._addAriaAndCollapsedClass(this._element, this._triggerArray) } + this._selectorActives = Selector.ACTIVES + if (this._parent) { + const childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null + if (childrenSelector !== null) { + this._selectorActives = childrenSelector + ' > .show, ' + childrenSelector + ' > .collapsing' + } + } + if (this._config.toggle) { this.toggle() } @@ -124,7 +133,7 @@ const Collapse = (($) => { let activesData if (this._parent) { - actives = $.makeArray($(this._parent).find(Selector.ACTIVES)) + actives = $.makeArray($(this._parent).find(this._selectorActives)) if (!actives.length) { actives = null } -- cgit v1.2.3 From fa1504e6f68974114e3ab58b8b18a601bc973103 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 8 Mar 2017 11:15:58 +0100 Subject: Fix code style --- js/src/collapse.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index e2c9efe11..0776519ff 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -78,7 +78,6 @@ const Collapse = (($) => { `[data-toggle="collapse"][href="#${element.id}"],` + `[data-toggle="collapse"][data-target="#${element.id}"]` )) - this._parent = this._config.parent ? this._getParent() : null if (!this._config.parent) { @@ -89,7 +88,7 @@ const Collapse = (($) => { if (this._parent) { const childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null if (childrenSelector !== null) { - this._selectorActives = childrenSelector + ' > .show, ' + childrenSelector + ' > .collapsing' + this._selectorActives = `${childrenSelector} > .show, ${childrenSelector} > .collapsing` } } -- cgit v1.2.3 From 1a46d8c7309092566c2da8cbaa9999ae0a1bacc7 Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 19 Mar 2017 00:36:33 +0100 Subject: Allow to use Tab.js with list-group (#21756) * Allow to use Tab.js with list-group * Allow to use list-group with div parent instead of an ul parent --- js/src/tab.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'js/src') diff --git a/js/src/tab.js b/js/src/tab.js index c069b0a9a..d5669b7ad 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -45,10 +45,10 @@ const Tab = (($) => { A : 'a', LI : 'li', DROPDOWN : '.dropdown', - LIST : 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)', - FADE_CHILD : '> .nav-item .fade, > .fade', + LIST : 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu), .list-group:not(.dropdown-menu)', + FADE_CHILD : '> .nav-item .fade, > .list-group-item .fade, > .fade', ACTIVE : '.active', - ACTIVE_CHILD : '> .nav-item > .active, > .active', + ACTIVE_CHILD : '> .nav-item > .active, > .list-group-item > .active, > .active', DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"]', DROPDOWN_TOGGLE : '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active' @@ -182,6 +182,9 @@ const Tab = (($) => { _transitionComplete(element, active, isTransitioning, callback) { if (active) { $(active).removeClass(ClassName.ACTIVE) + if ($(active).hasClass('list-group-item')) { + $(active).find('a.nav-link').removeClass(ClassName.ACTIVE) + } const dropdownChild = $(active.parentNode).find( Selector.DROPDOWN_ACTIVE_CHILD @@ -195,6 +198,9 @@ const Tab = (($) => { } $(element).addClass(ClassName.ACTIVE) + if ($(element.parentNode).hasClass('list-group-item')) { + $(element.parentNode).addClass(ClassName.ACTIVE) + } element.setAttribute('aria-expanded', true) if (isTransitioning) { -- cgit v1.2.3 From f2f805128508e82f0adc6e57b421dfb46d65a434 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Sat, 18 Mar 2017 20:41:13 -0400 Subject: Fix backdrop for dropdown menu on mobile (#21578) - Create backdrop only if the menu is actually open (do not create it if the show event is prevented) - Drop the backdrop only when the corresponding menu is closed (do not remove if there is no menu to close or if the hide event is prevented) --- js/src/dropdown.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'js/src') diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 1660d4257..644273a0a 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -97,16 +97,6 @@ const Dropdown = (($) => { return false } - if ('ontouchstart' in document.documentElement && - !$(parent).closest(Selector.NAVBAR_NAV).length) { - - // if mobile we use a backdrop because click events don't delegate - const dropdown = document.createElement('div') - dropdown.className = ClassName.BACKDROP - $(dropdown).insertBefore(this) - $(dropdown).on('click', Dropdown._clearMenus) - } - const relatedTarget = { relatedTarget : this } @@ -118,6 +108,17 @@ const Dropdown = (($) => { return false } + // set the backdrop only if the dropdown menu will be opened + if ('ontouchstart' in document.documentElement && + !$(parent).closest(Selector.NAVBAR_NAV).length) { + + // if mobile we use a backdrop because click events don't delegate + const dropdown = document.createElement('div') + dropdown.className = ClassName.BACKDROP + $(dropdown).insertBefore(this) + $(dropdown).on('click', Dropdown._clearMenus) + } + this.focus() this.setAttribute('aria-expanded', true) @@ -166,11 +167,6 @@ const Dropdown = (($) => { return } - const backdrop = $(Selector.BACKDROP)[0] - if (backdrop) { - backdrop.parentNode.removeChild(backdrop) - } - const toggles = $.makeArray($(Selector.DATA_TOGGLE)) for (let i = 0; i < toggles.length; i++) { @@ -195,6 +191,12 @@ const Dropdown = (($) => { continue } + // remove backdrop only if the dropdown menu will be hidden + const backdrop = $(parent).find(Selector.BACKDROP)[0] + if (backdrop) { + backdrop.parentNode.removeChild(backdrop) + } + toggles[i].setAttribute('aria-expanded', 'false') $(parent) -- cgit v1.2.3 From f2f2e39a45039658c3ed7a39af834ca8dd802bdc Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 19 Mar 2017 01:42:11 +0100 Subject: Fix getSelectorFromElement when # is a selector (#21615) * Fix getSelectorFromElement when # is a selector * Thanks to @vanduynslagerp remove regex to validate selector --- js/src/util.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'js/src') diff --git a/js/src/util.js b/js/src/util.js index 515eba6d9..3c0d02251 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -112,13 +112,16 @@ const Util = (($) => { getSelectorFromElement(element) { let selector = element.getAttribute('data-target') - - if (!selector) { + if (!selector || selector === '#') { selector = element.getAttribute('href') || '' - selector = /^#[a-z]/i.test(selector) ? selector : null } - return selector + try { + const $selector = $(selector) + return $selector.length > 0 ? selector : null + } catch (error) { + return null + } }, reflow(element) { -- cgit v1.2.3 From 275821bbb081890ffe232d50d4778eb15bdb1d7b Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Sat, 18 Mar 2017 21:24:54 -0400 Subject: HTMLElement.offset* by getBoundingClientRect() (#21788) * Replace element.offet* by getBoundingClientRect() * Use variable to store BoundingClientRect * Fix cc issue... --- js/src/collapse.js | 4 +--- js/src/modal.js | 2 +- js/src/scrollspy.js | 17 ++++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index 28c4493cc..ed3c064b1 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -211,10 +211,8 @@ const Collapse = (($) => { } const dimension = this._getDimension() - const offsetDimension = dimension === Dimension.WIDTH ? - 'offsetWidth' : 'offsetHeight' - this._element.style[dimension] = `${this._element[offsetDimension]}px` + this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px` Util.reflow(this._element) diff --git a/js/src/modal.js b/js/src/modal.js index 213434f77..9263efd53 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -450,7 +450,7 @@ const Modal = (($) => { const scrollDiv = document.createElement('div') scrollDiv.className = ClassName.SCROLLBAR_MEASURER document.body.appendChild(scrollDiv) - const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth + const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth document.body.removeChild(scrollDiv) return scrollbarWidth } diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 66b6080c8..15541b8ff 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -133,12 +133,15 @@ const ScrollSpy = (($) => { target = $(targetSelector)[0] } - if (target && (target.offsetWidth || target.offsetHeight)) { - // todo (fat): remove sketch reliance on jQuery position/offset - return [ - $(target)[offsetMethod]().top + offsetBase, - targetSelector - ] + if (target) { + const targetBCR = target.getBoundingClientRect() + if (targetBCR.width || targetBCR.height) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [ + $(target)[offsetMethod]().top + offsetBase, + targetSelector + ] + } } return null }) @@ -198,7 +201,7 @@ const ScrollSpy = (($) => { _getOffsetHeight() { return this._scrollElement === window ? - window.innerHeight : this._scrollElement.offsetHeight + window.innerHeight : this._scrollElement.getBoundingClientRect().height } _process() { -- cgit v1.2.3 From c72a315740c852152c1bc6a34bf2b4c2372fe389 Mon Sep 17 00:00:00 2001 From: Johann Date: Wed, 22 Mar 2017 22:42:13 +0100 Subject: Carousel - Add attributes from and to for Slid and Slide events (#21668) Carousel - Add attributes from and to for Slid and Slide events --- js/src/carousel.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'js/src') diff --git a/js/src/carousel.js b/js/src/carousel.js index 8a75cb240..1aca817f1 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -282,9 +282,13 @@ const Carousel = (($) => { _triggerSlideEvent(relatedTarget, eventDirectionName) { + const targetIndex = this._getItemIndex(relatedTarget) + const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]) const slideEvent = $.Event(Event.SLIDE, { relatedTarget, - direction: eventDirectionName + direction: eventDirectionName, + from: fromIndex, + to: targetIndex }) $(this._element).trigger(slideEvent) @@ -310,9 +314,10 @@ const Carousel = (($) => { _slide(direction, element) { const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0] + const activeElementIndex = this._getItemIndex(activeElement) const nextElement = element || activeElement && this._getItemByDirection(direction, activeElement) - + const nextElementIndex = this._getItemIndex(nextElement) const isCycling = Boolean(this._interval) let directionalClassName @@ -354,7 +359,9 @@ const Carousel = (($) => { const slidEvent = $.Event(Event.SLID, { relatedTarget: nextElement, - direction: eventDirectionName + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex }) if (Util.supportsTransitionEnd() && -- cgit v1.2.3 From 3f247a42f2a113f9e04184987eae9019abcac778 Mon Sep 17 00:00:00 2001 From: Johann Date: Thu, 23 Mar 2017 22:22:09 +0100 Subject: Fix Modal documentation about _handleUpdate method + move to public scope (#21877) Fix Modal documentation about _handleUpdate method + move to public scope --- js/src/modal.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'js/src') diff --git a/js/src/modal.js b/js/src/modal.js index 9263efd53..7f010b8e0 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -215,6 +215,9 @@ const Modal = (($) => { this._scrollbarWidth = null } + handleUpdate() { + this._adjustDialog() + } // private @@ -296,7 +299,7 @@ const Modal = (($) => { _setResizeEvent() { if (this._isShown) { - $(window).on(Event.RESIZE, (event) => this._handleUpdate(event)) + $(window).on(Event.RESIZE, (event) => this.handleUpdate(event)) } else { $(window).off(Event.RESIZE) } @@ -401,10 +404,6 @@ const Modal = (($) => { // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- - _handleUpdate() { - this._adjustDialog() - } - _adjustDialog() { const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight -- cgit v1.2.3 From 24924c23b24c1b196c42166ebe9a17d31f0ee720 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 27 Mar 2017 10:08:39 +0200 Subject: Collapse - do not prevent event for input and textarea --- js/src/collapse.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src') diff --git a/js/src/collapse.js b/js/src/collapse.js index 13c44502c..6f09fcadd 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -363,7 +363,9 @@ const Collapse = (($) => { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - event.preventDefault() + if (/input|textarea/i.test(event.target.tagName)) { + event.preventDefault() + } const target = Collapse._getTargetFromElement(this) const data = $(target).data(DATA_KEY) -- cgit v1.2.3 From 904efc043d298904d8020df7325bf01a5825a780 Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 28 Mar 2017 15:55:03 +0200 Subject: Fix different tooltips offset when hovering --- js/src/tooltip.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/src') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index e750dcecc..fe913e660 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -34,6 +34,7 @@ const Tooltip = (($) => { const JQUERY_NO_CONFLICT = $.fn[NAME] const TRANSITION_DURATION = 150 const CLASS_PREFIX = 'bs-tether' + const TETHER_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g') const Default = { animation : true, @@ -340,6 +341,7 @@ const Tooltip = (($) => { tip.parentNode.removeChild(tip) } + this._cleanTipClass() this.element.removeAttribute('aria-describedby') $(this.element).trigger(this.constructor.Event.HIDDEN) this._isTransitioning = false @@ -438,6 +440,14 @@ const Tooltip = (($) => { return AttachmentMap[placement.toUpperCase()] } + _cleanTipClass() { + const $tip = $(this.getTipElement()) + const tabClass = $tip.attr('class').match(TETHER_PREFIX_REGEX) + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')) + } + } + _setListeners() { const triggers = this.config.trigger.split(' ') -- cgit v1.2.3 From 48c5efa4c3c439d8720b8475ec3e372c6974a12a Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Tue, 28 Mar 2017 17:43:16 -0400 Subject: Fix JS components console error "Error: is transitioning" --- js/src/carousel.js | 10 ++++------ js/src/collapse.js | 14 ++++---------- js/src/modal.js | 19 ++++++++++--------- js/src/tooltip.js | 32 ++++++++++++-------------------- 4 files changed, 30 insertions(+), 45 deletions(-) (limited to 'js/src') diff --git a/js/src/carousel.js b/js/src/carousel.js index 1aca817f1..7c2da45ad 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -120,10 +120,9 @@ const Carousel = (($) => { // public next() { - if (this._isSliding) { - throw new Error('Carousel is sliding') + if (!this._isSliding) { + this._slide(Direction.NEXT) } - this._slide(Direction.NEXT) } nextWhenVisible() { @@ -134,10 +133,9 @@ const Carousel = (($) => { } prev() { - if (this._isSliding) { - throw new Error('Carousel is sliding') + if (!this._isSliding) { + this._slide(Direction.PREV) } - this._slide(Direction.PREV) } pause(event) { diff --git a/js/src/collapse.js b/js/src/collapse.js index 6f09fcadd..dc2e2a67d 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -120,11 +120,8 @@ const Collapse = (($) => { } show() { - if (this._isTransitioning) { - throw new Error('Collapse is transitioning') - } - - if ($(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || + $(this._element).hasClass(ClassName.SHOW)) { return } @@ -204,11 +201,8 @@ const Collapse = (($) => { } hide() { - if (this._isTransitioning) { - throw new Error('Collapse is transitioning') - } - - if (!$(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || + !$(this._element).hasClass(ClassName.SHOW)) { return } diff --git a/js/src/modal.js b/js/src/modal.js index 7f010b8e0..5e9941444 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -87,7 +87,6 @@ const Modal = (($) => { this._isShown = false this._isBodyOverflowing = false this._ignoreBackdropClick = false - this._isTransitioning = false this._originalBodyPadding = 0 this._scrollbarWidth = 0 } @@ -112,13 +111,13 @@ const Modal = (($) => { show(relatedTarget) { if (this._isTransitioning) { - throw new Error('Modal is transitioning') + return } - if (Util.supportsTransitionEnd() && - $(this._element).hasClass(ClassName.FADE)) { + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { this._isTransitioning = true } + const showEvent = $.Event(Event.SHOW, { relatedTarget }) @@ -161,17 +160,18 @@ const Modal = (($) => { event.preventDefault() } - if (this._isTransitioning) { - throw new Error('Modal is transitioning') + if (this._isTransitioning || !this._isShown) { + return } - const transition = Util.supportsTransitionEnd() && - $(this._element).hasClass(ClassName.FADE) + const transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE) + if (transition) { this._isTransitioning = true } const hideEvent = $.Event(Event.HIDE) + $(this._element).trigger(hideEvent) if (!this._isShown || hideEvent.isDefaultPrevented()) { @@ -191,6 +191,7 @@ const Modal = (($) => { $(this._dialog).off(Event.MOUSEDOWN_DISMISS) if (transition) { + $(this._element) .one(Util.TRANSITION_END, (event) => this._hideModal(event)) .emulateTransitionEnd(TRANSITION_DURATION) @@ -307,7 +308,7 @@ const Modal = (($) => { _hideModal() { this._element.style.display = 'none' - this._element.setAttribute('aria-hidden', 'true') + this._element.setAttribute('aria-hidden', true) this._isTransitioning = false this._showBackdrop(() => { $(document.body).removeClass(ClassName.OPEN) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index fe913e660..5fd4987b9 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -124,12 +124,11 @@ const Tooltip = (($) => { constructor(element, config) { // private - this._isEnabled = true - this._timeout = 0 - this._hoverState = '' - this._activeTrigger = {} - this._isTransitioning = false - this._tether = null + this._isEnabled = true + this._timeout = 0 + this._hoverState = '' + this._activeTrigger = {} + this._tether = null // protected this.element = element @@ -250,9 +249,6 @@ const Tooltip = (($) => { const showEvent = $.Event(this.constructor.Event.SHOW) if (this.isWithContent() && this._isEnabled) { - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning') - } $(this.element).trigger(showEvent) const isInTheDom = $.contains( @@ -284,9 +280,11 @@ const Tooltip = (($) => { const container = this.config.container === false ? document.body : $(this.config.container) - $(tip) - .data(this.constructor.DATA_KEY, this) - .appendTo(container) + $(tip).data(this.constructor.DATA_KEY, this) + + if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { + $(tip).appendTo(container) + } $(this.element).trigger(this.constructor.Event.INSERTED) @@ -308,8 +306,7 @@ const Tooltip = (($) => { const complete = () => { const prevHoverState = this._hoverState - this._hoverState = null - this._isTransitioning = false + this._hoverState = null $(this.element).trigger(this.constructor.Event.SHOWN) @@ -319,7 +316,6 @@ const Tooltip = (($) => { } if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true $(this.tip) .one(Util.TRANSITION_END, complete) .emulateTransitionEnd(Tooltip._TRANSITION_DURATION) @@ -333,9 +329,6 @@ const Tooltip = (($) => { hide(callback) { const tip = this.getTipElement() const hideEvent = $.Event(this.constructor.Event.HIDE) - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning') - } const complete = () => { if (this._hoverState !== HoverState.SHOW && tip.parentNode) { tip.parentNode.removeChild(tip) @@ -344,7 +337,6 @@ const Tooltip = (($) => { this._cleanTipClass() this.element.removeAttribute('aria-describedby') $(this.element).trigger(this.constructor.Event.HIDDEN) - this._isTransitioning = false this.cleanupTether() if (callback) { @@ -366,7 +358,7 @@ const Tooltip = (($) => { if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true + $(tip) .one(Util.TRANSITION_END, complete) .emulateTransitionEnd(TRANSITION_DURATION) -- cgit v1.2.3 From fb42d6e0435bb101c0505090055e8034cb101dc4 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 29 Mar 2017 00:10:27 +0200 Subject: Collapse - Fix check to not prevent event for input and textarea --- 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 dc2e2a67d..88428310d 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -357,7 +357,7 @@ const Collapse = (($) => { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - if (/input|textarea/i.test(event.target.tagName)) { + if (!/input|textarea/i.test(event.target.tagName)) { event.preventDefault() } -- cgit v1.2.3 From 5142de7e592abc0a791ea3465616795c91219bcc Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 31 Mar 2017 10:03:54 +0200 Subject: Popover + Tooltip - fix error when content or title is a number --- js/src/tooltip.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/src') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 5fd4987b9..1ff2c4f6e 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -605,6 +605,14 @@ const Tooltip = (($) => { } } + if (config.title && typeof config.title === 'number') { + config.title = config.title.toString() + } + + if (config.content && typeof config.content === 'number') { + config.content = config.content.toString() + } + Util.typeCheckConfig( NAME, config, -- cgit v1.2.3 From 91b62941afb7115807fc2925398ebccfc68f5377 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Sun, 2 Apr 2017 05:21:04 -0400 Subject: Tabs/Scrollspy/.nav/.list-group/.active independent of markup (