From bb16f7609121716ce96b31340e82651bcbe8dee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laussel=20LO=C3=AFc?= Date: Mon, 3 Apr 2017 09:17:04 +0200 Subject: [PATCH] fix(transitionning): merge bootstrap fix for component is transitionning. See issue #50 --- js/dist/carousel.js | 23 ++++++++++++++--------- js/dist/carousel.js.map | 2 +- js/dist/collapse.js | 33 +++++++++++++++++---------------- js/dist/collapse.js.map | 2 +- js/dist/scrollspy.js | 11 +++++++---- js/dist/scrollspy.js.map | 2 +- js/dist/tooltip.js | 18 ++++++------------ js/dist/tooltip.js.map | 2 +- js/dist/util.js | 11 +++++++---- js/dist/util.js.map | 2 +- js/src/carousel.js | 23 ++++++++++++++--------- js/src/collapse.js | 34 ++++++++++++++++++---------------- js/src/scrollspy.js | 7 +++++-- js/src/tooltip.js | 20 ++++++-------------- js/src/util.js | 11 +++++++---- 15 files changed, 106 insertions(+), 95 deletions(-) diff --git a/js/dist/carousel.js b/js/dist/carousel.js index 6e4269245f..77d6e80d90 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -112,10 +112,9 @@ var Carousel = function ($) { // public Carousel.prototype.next = function next() { - if (this._isSliding) { - throw new Error('Carousel is sliding'); + if (!this._isSliding) { + this._slide(Direction.NEXT); } - this._slide(Direction.NEXT); }; Carousel.prototype.nextWhenVisible = function nextWhenVisible() { @@ -126,10 +125,9 @@ var Carousel = function ($) { }; Carousel.prototype.prev = function prev() { - if (this._isSliding) { - throw new Error('Carousel is sliding'); + if (!this._isSliding) { + this._slide(Direction.PREV); } - this._slide(Direction.PREV); }; Carousel.prototype.pause = function pause(event) { @@ -272,9 +270,13 @@ var Carousel = function ($) { }; Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]); var slideEvent = $.Event(Event.SLIDE, { relatedTarget: relatedTarget, - direction: eventDirectionName + direction: eventDirectionName, + from: fromIndex, + to: targetIndex }); $(this._element).trigger(slideEvent); @@ -298,8 +300,9 @@ var Carousel = function ($) { var _this3 = this; var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var activeElementIndex = this._getItemIndex(activeElement); var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - + var nextElementIndex = this._getItemIndex(nextElement); var isCycling = Boolean(this._interval); var directionalClassName = void 0; @@ -341,7 +344,9 @@ var Carousel = function ($) { var slidEvent = $.Event(Event.SLID, { relatedTarget: nextElement, - direction: eventDirectionName + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex }); if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { diff --git a/js/dist/carousel.js.map b/js/dist/carousel.js.map index 4edaef0b7e..3e8fdfd2dd 100644 --- a/js/dist/carousel.js.map +++ b/js/dist/carousel.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/carousel.js"],"names":["Carousel","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","_config","_getConfig","_element","_indicatorsElement","find","_addEventListeners","next","Error","_slide","nextWhenVisible","document","hidden","prev","event","Util","supportsTransitionEnd","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","extend","typeCheckConfig","on","_keydown","documentElement","test","target","tagName","which","preventDefault","makeArray","parent","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","slideEvent","trigger","_setActiveIndicatorElement","removeClass","nextIndicator","children","addClass","nextElement","isCycling","Boolean","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","TRANSITION_END","setTimeout","emulateTransitionEnd","_jQueryInterface","each","data","action","undefined","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","getAttribute","call","window","$carousel","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;AACA,MAAMC,qBAAsB,EAA5B,CAhBuB,CAgBQ;AAC/B,MAAMC,sBAAsB,EAA5B,CAjBuB,CAiBQ;;AAE/B,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,KAHG;AAIdC,WAAW,OAJG;AAKdC,UAAW;AALG,GAAhB;;AAQA,MAAMC,cAAc;AAClBL,cAAW,kBADO;AAElBC,cAAW,SAFO;AAGlBC,WAAW,kBAHO;AAIlBC,WAAW,kBAJO;AAKlBC,UAAW;AALO,GAApB;;AAQA,MAAME,YAAY;AAChBC,UAAW,MADK;AAEhBC,UAAW,MAFK;AAGhBC,UAAW,MAHK;AAIhBC,WAAW;AAJK,GAAlB;;AAOA,MAAMC,QAAQ;AACZC,qBAAyBpB,SADb;AAEZqB,mBAAwBrB,SAFZ;AAGZsB,yBAA2BtB,SAHf;AAIZuB,+BAA8BvB,SAJlB;AAKZwB,+BAA8BxB,S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AlB;AACAD,eAAS4H,gBAAT,CAA0BU,IAA1B,CAA+BE,SAA/B,EAA0CA,UAAUV,IAAV,EAA1C;AACD,KAHD;AAID,GALD;;AAQA;;;;;;AAMA7H,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS4H,gBAAlC;AACA3H,IAAEO,EAAF,CAAKN,IAAL,EAAWuI,WAAX,GAAyBzI,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWwI,UAAX,GAAyB,YAAY;AACnCzI,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS4H,gBAAhB;AACD,GAHD;;AAKA,SAAO5H,QAAP;AAED,CApegB,CAoed2I,MApec,CAAjB","file":"carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Carousel = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'carousel'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.carousel'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\n const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\n\n const Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean'\n }\n\n const Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n }\n\n const Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item'\n }\n\n const Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel {\n\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n\n this._isPaused = false\n this._isSliding = false\n\n this._config = this._getConfig(config)\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n next() {\n if (this._isSliding) {\n throw new Error('Carousel is sliding')\n }\n this._slide(Direction.NEXT)\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n if (!document.hidden) {\n this.next()\n }\n }\n\n prev() {\n if (this._isSliding) {\n throw new Error('Carousel is sliding')\n }\n this._slide(Direction.PREV)\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0] &&\n Util.supportsTransitionEnd()) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover' &&\n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n return\n }\n }\n\n _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM))\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1 ?\n this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement)\n .find(Selector.ACTIVE)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n\n })\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (data[action] === undefined) {\n throw new Error(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = $.extend({}, $(target).data(), $(this).data())\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD_DATA_API, () => {\n $(Selector.DATA_RIDE).each(function () {\n const $carousel = $(this)\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n })\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface\n $.fn[NAME].Constructor = Carousel\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n }\n\n return Carousel\n\n})(jQuery)\n\nexport default Carousel\n"]} \ No newline at end of file +{"version":3,"sources":["../src/carousel.js"],"names":["Carousel","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","_config","_getConfig","_element","_indicatorsElement","find","_addEventListeners","next","_slide","nextWhenVisible","document","hidden","prev","event","Util","supportsTransitionEnd","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","extend","typeCheckConfig","on","_keydown","documentElement","test","target","tagName","which","preventDefault","makeArray","parent","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","_setActiveIndicatorElement","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","nextElementIndex","isCycling","Boolean","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","TRANSITION_END","setTimeout","emulateTransitionEnd","_jQueryInterface","each","data","action","undefined","Error","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","getAttribute","call","window","$carousel","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;AACA,MAAMC,qBAAsB,EAA5B,CAhBuB,CAgBQ;AAC/B,MAAMC,sBAAsB,EAA5B,CAjBuB,CAiBQ;;AAE/B,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,KAHG;AAIdC,WAAW,OAJG;AAKdC,UAAW;AALG,GAAhB;;AAQA,MAAMC,cAAc;AAClBL,cAAW,kBADO;AAElBC,cAAW,SAFO;AAGlBC,WAAW,kBAHO;AAIlBC,WAAW,kBAJO;AAKlBC,UAAW;AALO,GAApB;;AAQA,MAAME,YAAY;AAChBC,UAAW,MADK;AAEhBC,UAAW,MAFK;AAGhBC,UAAW,MAHK;AAIhBC,WAAW;AAJK,GAAlB;;AAOA,MAAMC,QAAQ;AACZC,qBAAyBpB,SADb;AAEZqB,mBAAwBrB,SAFZ;AAGZsB,yBAA2BtB,SAHf;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eAAOtF,OAAP;AACD;AAtGoB;AAAA;AAAA,0BAwGA;AACnB,eAAOS,OAAP;AACD;AA1GoB;;AAAA;AAAA;;AAycvB;;;;;;AAMAX,IAAEyD,QAAF,EACGwB,EADH,CACM1D,MAAMO,cADZ,EAC4BK,SAASI,UADrC,EACiDxC,SAASsI,oBAD1D;;AAGArI,IAAE2I,MAAF,EAAU1D,EAAV,CAAa1D,MAAMM,aAAnB,EAAkC,YAAM;AACtC7B,MAAEmC,SAASK,SAAX,EAAsBwF,IAAtB,CAA2B,YAAY;AACrC,UAAMY,YAAY5I,EAAE,IAAF,CAAlB;AACAD,eAASgI,gBAAT,CAA0BW,IAA1B,CAA+BE,SAA/B,EAA0CA,UAAUX,IAAV,EAA1C;AACD,KAHD;AAID,GALD;;AAQA;;;;;;AAMAjI,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAASgI,gBAAlC;AACA/H,IAAEO,EAAF,CAAKN,IAAL,EAAW4I,WAAX,GAAyB9I,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAW6I,UAAX,GAAyB,YAAY;AACnC9I,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAASgI,gBAAhB;AACD,GAHD;;AAKA,SAAOhI,QAAP;AAED,CAzegB,CAyedgJ,MAzec,CAAjB","file":"carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Carousel = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'carousel'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.carousel'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\n const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\n\n const Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean'\n }\n\n const Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n }\n\n const Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item'\n }\n\n const Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel {\n\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n\n this._isPaused = false\n this._isSliding = false\n\n this._config = this._getConfig(config)\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n if (!document.hidden) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0] &&\n Util.supportsTransitionEnd()) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover' &&\n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n return\n }\n }\n\n _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM))\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1 ?\n this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0])\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement)\n .find(Selector.ACTIVE)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n\n })\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (data[action] === undefined) {\n throw new Error(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = $.extend({}, $(target).data(), $(this).data())\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD_DATA_API, () => {\n $(Selector.DATA_RIDE).each(function () {\n const $carousel = $(this)\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n })\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface\n $.fn[NAME].Constructor = Carousel\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n }\n\n return Carousel\n\n})(jQuery)\n\nexport default Carousel\n"]} \ No newline at end of file diff --git a/js/dist/collapse.js b/js/dist/collapse.js index 1ce89a36c8..4030568136 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -59,7 +59,8 @@ var Collapse = function ($) { var Selector = { ACTIVES: '.card:not(.multi) > .show, .card:not(.multi) > .collapsing', // boosted mod - DATA_TOGGLE: '[data-toggle="collapse"]' + DATA_TOGGLE: '[data-toggle="collapse"]', + DATA_CHILDREN: 'data-children' }; /** @@ -76,13 +77,20 @@ var Collapse = function ($) { this._element = element; this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[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) { this._addAriaAndCollapsedClass(this._element, this._triggerArray); } + this._selectorActives = Selector.ACTIVES; + if (this._parent) { + var 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(); } @@ -103,11 +111,7 @@ var Collapse = function ($) { Collapse.prototype.show = function show() { var _this = this; - if (this._isTransitioning) { - throw new Error('Collapse is transitioning'); - } - - if ($(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) { return; } @@ -115,7 +119,7 @@ var Collapse = function ($) { var activesData = void 0; if (this._parent) { - actives = $.makeArray($(this._parent).find(Selector.ACTIVES)); + actives = $.makeArray($(this._parent).find(this._selectorActives)); if (!actives.length) { actives = null; } @@ -180,11 +184,7 @@ var Collapse = function ($) { Collapse.prototype.hide = function hide() { var _this2 = this; - if (this._isTransitioning) { - throw new Error('Collapse is transitioning'); - } - - if (!$(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) { return; } @@ -195,9 +195,8 @@ var Collapse = function ($) { } var dimension = this._getDimension(); - var 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); @@ -351,7 +350,9 @@ var Collapse = function ($) { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - event.preventDefault(); + if (!/input|textarea/i.test(event.target.tagName)) { + event.preventDefault(); + } var target = Collapse._getTargetFromElement(this); var data = $(target).data(DATA_KEY); diff --git a/js/dist/collapse.js.map b/js/dist/collapse.js.map index 71fa4cec0f..4f87a6039b 100644 --- a/js/dist/collapse.js.map +++ b/js/dist/collapse.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/collapse.js"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","Error","actives","activesData","find","length","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","setAttribute","attr","setTransitioning","complete","Util","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","offsetDimension","reflow","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","selector","each","i","_getTargetFromElement","triggerArray","isOpen","toggleClass","getSelectorFromElement","$this","test","undefined","role","document","on","event","preventDefault","target","currentTarget","prev","text","ready","next","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA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,IAAEO,EAAF,CAAKN,IAAL,EAAWuG,WAAX,GAAyBzG,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWwG,UAAX,GAAyB,YAAY;AACnCzG,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAASsD,gBAAhB;AACD,GAHD;;AAKA,SAAOtD,QAAP;AAED,CAjagB,CAiad2G,MAjac,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.collapse'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Default = {\n toggle : true,\n parent : ''\n }\n\n const DefaultType = {\n toggle : 'boolean',\n parent : 'string'\n }\n\n const Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n }\n\n const Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n }\n\n const Selector = {\n ACTIVES : '.card:not(.multi) > .show, .card:not(.multi) > .collapsing', // boosted mod\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning) {\n throw new Error('Collapse is transitioning')\n }\n\n if ($(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).find(Selector.ACTIVES))\n if (!actives.length) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n this._element.setAttribute('aria-expanded', true)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning) {\n throw new Error('Collapse is transitioning')\n }\n\n if (!$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n const offsetDimension = dimension === Dimension.WIDTH ?\n 'offsetWidth' : 'offsetHeight'\n\n this._element.style[dimension] = `${this._element[offsetDimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n this._element.setAttribute('aria-expanded', false)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n config.toggle = Boolean(config.toggle) // coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n const parent = $(this._config.parent)[0]\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n $(parent).find(selector).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n element.setAttribute('aria-expanded', isOpen)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n }\n\n\n // static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = $.extend(\n {},\n Default,\n $this.data(),\n typeof config === 'object' && config\n )\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n /**\n * ------------------------------------------------------------------------\n * Adding accessibility\n * ------------------------------------------------------------------------\n */\n\n // single collapse\n // add aria-controls attribute\n\n // accordion tabs\n // add role tab & tabpanel\n\n $('.panel-heading').attr(\n {\n role: 'tab'\n }\n )\n $('.panel-collapse:not(.mega-menu)').attr(\n {\n role: 'tabpanel'\n }\n )\n $('.panel').attr('role', 'presentation')\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n const target = Collapse._getTargetFromElement(this)\n const data = $(target).data(DATA_KEY)\n const config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n $(() => {\n // local navigation\n $('.o-nav-local .nav.collapse .nav-link').on('click', (event) => {\n $(event.currentTarget).parent().parent().prev('.local-select').text($(event.currentTarget).text())\n })\n\n $('.o-nav-local .nav.collapse').on('shown.bs.collapse', (event) => {\n $(event.currentTarget).find('.nav-item:first-child .nav-link').trigger('focus')\n })\n\n $(document).ready(() => {\n $('.o-nav-local .local-select').each(function () {\n $(this).text($(this).next('.nav.collapse').find('.nav-item:first-child .nav-link').text())\n })\n })\n\n $(document).on('click', () => {\n Collapse._jQueryInterface.call($('.o-nav-local .collapse.show'), 'hide')\n })\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]} \ No newline at end of file +{"version":3,"sources":["../src/collapse.js"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","DATA_CHILDREN","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","_parent","_getParent","_addAriaAndCollapsedClass","_selectorActives","childrenSelector","hasAttribute","getAttribute","hasClass","hide","show","actives","activesData","find","length","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","setAttribute","attr","setTransitioning","complete","Util","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","selector","each","i","_getTargetFromElement","triggerArray","isOpen","toggleClass","getSelectorFromElement","$this","test","undefined","Error","role","document","on","event","target","tagName","preventDefault","currentTarget","prev","text","ready","next","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;;AAEA,MAAMC,UAAU;AACdC,YAAS,IADK;AAEdC,YAAS;AAFK,GAAhB;;AAKA,MAAMC,cAAc;AAClBF,YAAS,SADS;AAElBC,YAAS;AAFS,GAApB;;AAKA,MAAME,QAAQ;AACZC,mBAAwBV,SADZ;AAEZW,qBAAyBX,SAFb;AAGZY,mBAAwBZ,SAHZ;AAIZa,uBAA0Bb,SAJd;AAKZc,8BAAyBd,SAAzB,GAAqCC;AALzB,GAAd;;AAQA,MAAMc,YAAY;AAChBL,UAAa,MADG;AAEhBM,cAAa,UAFG;AAGhBC,gBAAa,YAHG;AAIhBC,eAAa;AAJG,GAAlB;;AAOA,MAAMC,YAAY;AAChBC,WAAS,OADO;AAEhBC,YAAS;AAFO,GAAlB;;AAKA,MAAMC,WAAW;AACfC,aAAc,4DADC,EAC6D;AAC5EC,iBAAc,0BAFC;AAGfC,mBAAgB;AAHD,GAAjB;;AAOA;;;;;;AAtDuB,MA4DjB9B,QA5DiB;AA8DrB,sBAAY+B,OAAZ,EAAqBC,MAArB,EAA6B;AAAA;;AAC3B,WAAKC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KAFD;;AAIA3G,MAAE,4BAAF,EAAgCoG,EAAhC,CAAmC,mBAAnC,EAAwD,UAACC,KAAD,EAAW;AACjErG,QAAEqG,MAAMI,aAAR,EAAuBtD,IAAvB,CAA4B,iCAA5B,EAA+DI,OAA/D,CAAuE,OAAvE;AACD,KAFD;;AAIAvD,MAAEmG,QAAF,EAAYS,KAAZ,CAAkB,YAAM;AACtB5G,QAAE,4BAAF,EAAgCuF,IAAhC,CAAqC,YAAY;AAC/CvF,UAAE,IAAF,EAAQ2G,IAAR,CAAa3G,EAAE,IAAF,EAAQ6G,IAAR,CAAa,eAAb,EAA8B1D,IAA9B,CAAmC,iCAAnC,EAAsEwD,IAAtE,EAAb;AACD,OAFD;AAGD,KAJD;;AAMA3G,MAAEmG,QAAF,EAAYC,EAAZ,CAAe,OAAf,EAAwB,YAAM;AAC5BrG,eAAS0D,gBAAT,CAA0BC,IAA1B,CAA+B1D,EAAE,6BAAF,CAA/B,EAAiE,MAAjE;AACD,KAFD;AAGD,GAnBD;;AAqBA;;;;;;AAMAA,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS0D,gBAAlC;AACAzD,IAAEO,EAAF,CAAKN,IAAL,EAAW6G,WAAX,GAAyB/G,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAW8G,UAAX,GAAyB,YAAY;AACnC/G,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS0D,gBAAhB;AACD,GAHD;;AAKA,SAAO1D,QAAP;AAED,CAnagB,CAmadiH,MAnac,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.collapse'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Default = {\n toggle : true,\n parent : ''\n }\n\n const DefaultType = {\n toggle : 'boolean',\n parent : 'string'\n }\n\n const Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n }\n\n const Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n }\n\n const Selector = {\n ACTIVES : '.card:not(.multi) > .show, .card:not(.multi) > .collapsing', // boosted mod\n DATA_TOGGLE : '[data-toggle=\"collapse\"]',\n DATA_CHILDREN : 'data-children'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n this._selectorActives = Selector.ACTIVES\n if (this._parent) {\n const childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null\n if (childrenSelector !== null) {\n this._selectorActives = `${childrenSelector} > .show, ${childrenSelector} > .collapsing`\n }\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).find(this._selectorActives))\n if (!actives.length) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n this._element.setAttribute('aria-expanded', true)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n this._element.setAttribute('aria-expanded', false)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n config.toggle = Boolean(config.toggle) // coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n const parent = $(this._config.parent)[0]\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n $(parent).find(selector).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n element.setAttribute('aria-expanded', isOpen)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n }\n\n\n // static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = $.extend(\n {},\n Default,\n $this.data(),\n typeof config === 'object' && config\n )\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n /**\n * ------------------------------------------------------------------------\n * Adding accessibility\n * ------------------------------------------------------------------------\n */\n\n // single collapse\n // add aria-controls attribute\n\n // accordion tabs\n // add role tab & tabpanel\n\n $('.panel-heading').attr(\n {\n role: 'tab'\n }\n )\n $('.panel-collapse:not(.mega-menu)').attr(\n {\n role: 'tabpanel'\n }\n )\n $('.panel').attr('role', 'presentation')\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n if (!/input|textarea/i.test(event.target.tagName)) {\n event.preventDefault()\n }\n\n const target = Collapse._getTargetFromElement(this)\n const data = $(target).data(DATA_KEY)\n const config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n $(() => {\n // local navigation\n $('.o-nav-local .nav.collapse .nav-link').on('click', (event) => {\n $(event.currentTarget).parent().parent().prev('.local-select').text($(event.currentTarget).text())\n })\n\n $('.o-nav-local .nav.collapse').on('shown.bs.collapse', (event) => {\n $(event.currentTarget).find('.nav-item:first-child .nav-link').trigger('focus')\n })\n\n $(document).ready(() => {\n $('.o-nav-local .local-select').each(function () {\n $(this).text($(this).next('.nav.collapse').find('.nav-item:first-child .nav-link').text())\n })\n })\n\n $(document).on('click', () => {\n Collapse._jQueryInterface.call($('.o-nav-local .collapse.show'), 'hide')\n })\n })\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]} \ No newline at end of file diff --git a/js/dist/scrollspy.js b/js/dist/scrollspy.js index 52cf3de3b4..10fc3c394a 100644 --- a/js/dist/scrollspy.js +++ b/js/dist/scrollspy.js @@ -126,9 +126,12 @@ var ScrollSpy = function ($) { 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) { + var 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; }).filter(function (item) { @@ -183,7 +186,7 @@ var ScrollSpy = function ($) { }; ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() { - return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight; + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; }; ScrollSpy.prototype._process = function _process() { diff --git a/js/dist/scrollspy.js.map b/js/dist/scrollspy.js.map index d02dc89931..5f9a0f3e29 100644 --- a/js/dist/scrollspy.js.map +++ b/js/dist/scrollspy.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/scrollspy.js"],"names":["ScrollSpy","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","NAV_LINK","NAV","ACTIVE","Selector","DATA_SPY","LIST_ITEM","LI","LI_DROPDOWN","NAV_LINKS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","makeArray","map","targetSelector","Util","getSelectorFromElement","offsetWidth","offsetHeight","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","extend","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","document","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","i","isActiveTarget","undefined","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","trigger","relatedTarget","removeClass","_jQueryInterface","each","data","Error","scrollSpys","$spy","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,YAAa,UAACC,CAAD,EAAO;;AAGxB;;;;;;AAMA,MAAMC,OAAqB,WAA3B;AACA,MAAMC,UAAqB,eAA3B;AACA,MAAMC,WAAqB,cAA3B;AACA,MAAMC,kBAAyBD,QAA/B;AACA,MAAME,eAAqB,WAA3B;AACA,MAAMC,qBAAqBN,EAAEO,EAAF,CAAKN,IAAL,CAA3B;;AAEA,MAAMO,UAAU;AACdC,YAAS,EADK;AAEdC,YAAS,MAFK;AAGdC,YAAS;AAHK,GAAhB;;AAMA,MAAMC,cAAc;AAClBH,YAAS,QADS;AAElBC,YAAS,QAFS;AAGlBC,YAAS;AAHS,GAApB;;AAMA,MAAME,QAAQ;AACZC,2BAA2BV,SADf;AAEZW,uBAAyBX,SAFb;AAGZY,4BAAuBZ,SAAvB,GAAmCC;AAHvB,GAAd;;AAMA,MAAMY,YAAY;AAChBC,mBAAgB,eADA;AAEhBC,mBAAg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IAAyBF,UAAUgH,gBAAnC;AACA/G,IAAEO,EAAF,CAAKN,IAAL,EAAWqH,WAAX,GAAyBvH,SAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWsH,UAAX,GAAyB,YAAY;AACnCvH,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,UAAUgH,gBAAjB;AACD,GAHD;;AAKA,SAAOhH,SAAP;AAED,CA/TiB,CA+TfyH,MA/Te,CAAlB","file":"scrollspy.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst ScrollSpy = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'scrollspy'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.scrollspy'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n offset : 10,\n method : 'auto',\n target : ''\n }\n\n const DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n }\n\n const Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n NAV_LINK : 'nav-link',\n NAV : 'nav',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n LIST_ITEM : '.list-item',\n LI : 'li',\n LI_DROPDOWN : 'li.dropdown',\n NAV_LINKS : '.nav-link',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n }\n\n const OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy {\n\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},`\n + `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n refresh() {\n const autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target && (target.offsetWidth || target.offsetHeight)) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight : this._scrollElement.offsetHeight\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset\n + scrollHeight\n - this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i]\n && scrollTop >= this._offsets[i]\n && (this._offsets[i + 1] === undefined ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n let queries = this._selector.split(',')\n queries = queries.map((selector) => {\n return `${selector}[data-target=\"${target}\"],` +\n `${selector}[href=\"${target}\"]`\n })\n\n const $link = $(queries.join(','))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // todo (fat) this is kinda sus...\n // recursively add actives to tested nav-links\n $link.parents(Selector.LI).find(`> ${Selector.NAV_LINKS}`).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n\n return ScrollSpy\n\n})(jQuery)\n\nexport default ScrollSpy\n"]} \ No newline at end of file +{"version":3,"sources":["../src/scrollspy.js"],"names":["ScrollSpy","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","NAV_LINK","NAV","ACTIVE","Selector","DATA_SPY","LIST_ITEM","LI","LI_DROPDOWN","NAV_LINKS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","makeArray","map","targetSelector","Util","getSelectorFromElement","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","extend","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","document","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","i","isActiveTarget","undefined","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","trigger","relatedTarget","removeClass","_jQueryInterface","each","data","Error","scrollSpys","$spy","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,YAAa,UAACC,CAAD,EAAO;;AAGxB;;;;;;AAMA,MAAMC,OAAqB,WAA3B;AACA,MAAMC,UAAqB,eAA3B;AACA,MAAMC,WAAqB,cAA3B;AACA,MAAMC,kBAAyBD,QAA/B;AACA,MAAME,eAAqB,WAA3B;AACA,MAAMC,qBAAqBN,EAAEO,EAAF,CAAKN,IAAL,CAA3B;;AAEA,MAAMO,UAAU;AACdC,YAAS,EADK;AAEdC,YAAS,MAFK;AAGdC,YAAS;AAHK,GAAhB;;AAMA,MAAMC,cAAc;AAClBH,YAAS,QADS;AAElBC,YAAS,QAFS;AAGlBC,YAAS;AAHS,GAApB;;AAMA,MAAME,QAAQ;AACZC,2BAA2BV,SADf;AAEZW,uBAAyBX,SAFb;AAGZY,4BAAuBZ,SAAvB,GAAmCC;AAHvB,GAAd;;AAMA,MAAMY,YAAY;AAChBC,mBAAgB,eADA;AAEhBC,mBAAgB,eAFA;AAGhBC,cAAgB,UAHA;AAIhBC,SAAgB,KAJA;AAKhBC,YAAgB;AALA,GAAlB;;AAQA,MAAMC,WAAW;AACfC,cAAkB,qBADH;AAEfF,YAAkB,SAFH;AAGfG,eAAkB,YAHH;A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zB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWwH,UAAX,GAAyB,YAAY;AACnCzH,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,UAAUkH,gBAAjB;AACD,GAHD;;AAKA,SAAOlH,SAAP;AAED,CAlUiB,CAkUf2H,MAlUe,CAAlB","file":"scrollspy.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst ScrollSpy = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'scrollspy'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.scrollspy'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n offset : 10,\n method : 'auto',\n target : ''\n }\n\n const DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n }\n\n const Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n NAV_LINK : 'nav-link',\n NAV : 'nav',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n LIST_ITEM : '.list-item',\n LI : 'li',\n LI_DROPDOWN : 'li.dropdown',\n NAV_LINKS : '.nav-link',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n }\n\n const OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy {\n\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},`\n + `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n refresh() {\n const autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset\n + scrollHeight\n - this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i]\n && scrollTop >= this._offsets[i]\n && (this._offsets[i + 1] === undefined ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n let queries = this._selector.split(',')\n queries = queries.map((selector) => {\n return `${selector}[data-target=\"${target}\"],` +\n `${selector}[href=\"${target}\"]`\n })\n\n const $link = $(queries.join(','))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // todo (fat) this is kinda sus...\n // recursively add actives to tested nav-links\n $link.parents(Selector.LI).find(`> ${Selector.NAV_LINKS}`).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n\n return ScrollSpy\n\n})(jQuery)\n\nexport default ScrollSpy\n"]} \ No newline at end of file diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index a7a9f42262..f02821e9dd 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -125,7 +125,6 @@ var Tooltip = function ($) { this._timeout = 0; this._hoverState = ''; this._activeTrigger = {}; - this._isTransitioning = false; this._tether = null; // protected @@ -214,9 +213,6 @@ var Tooltip = function ($) { var showEvent = $.Event(this.constructor.Event.SHOW); if (this.isWithContent() && this._isEnabled) { - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning'); - } $(this.element).trigger(showEvent); var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); @@ -243,7 +239,11 @@ var Tooltip = function ($) { var 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); @@ -266,7 +266,6 @@ var Tooltip = function ($) { var complete = function complete() { var prevHoverState = _this._hoverState; _this._hoverState = null; - _this._isTransitioning = false; $(_this.element).trigger(_this.constructor.Event.SHOWN); @@ -276,7 +275,6 @@ var Tooltip = function ($) { }; if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true; $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); return; } @@ -290,9 +288,6 @@ var Tooltip = function ($) { var tip = this.getTipElement(); var hideEvent = $.Event(this.constructor.Event.HIDE); - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning'); - } var complete = function complete() { if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { tip.parentNode.removeChild(tip); @@ -300,7 +295,6 @@ var Tooltip = function ($) { _this2.element.removeAttribute('aria-describedby'); $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); - _this2._isTransitioning = false; _this2.cleanupTether(); if (callback) { @@ -321,7 +315,7 @@ var Tooltip = function ($) { this._activeTrigger[Trigger.HOVER] = false; if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true; + $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); } else { complete(); diff --git a/js/dist/tooltip.js.map b/js/dist/tooltip.js.map index 06d71e2a36..28917a31de 100644 --- a/js/dist/tooltip.js.map +++ b/js/dist/tooltip.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tooltip.js"],"names":["Tooltip","$","Tether","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","CLASS_PREFIX","Default","animation","template","trigger","title","delay","html","selector","placement","offset","constraints","container","DefaultType","AttachmentMap","TOP","RIGHT","BOTTOM","LEFT","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","TetherClass","element","enabled","Trigger","HOVER","FOCUS","MANUAL","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_isTransitioning","_tether","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","cleanupTether","removeData","off","closest","remove","show","css","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","document","body","appendTo","target","classes","classPrefix","addTargetClasses","reflow","position","complete","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","hide","callback","hideEvent","parentNode","removeChild","removeAttribute","removeClass","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","destroy","toUpperCase","triggers","split","forEach","on","eventIn","eventOut","extend","_fixTitle","titleType","type","setTimeout","typeCheckConfig","key","_jQueryInterface","each","_config","test","undefined","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAEtB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAGD;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD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iK,WAAX,GAAyBrK,OAAzB;AACAC,IAAEQ,EAAF,CAAKL,IAAL,EAAWkK,UAAX,GAAyB,YAAY;AACnCrK,MAAEQ,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAOR,QAAQgK,gBAAf;AACD,GAHD;;AAKA,SAAOhK,OAAP;AAED,CAppBe,CAopBbuK,MAppBa,CAAhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Tether */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Tether dependency\n * Tether - http://tether.io/\n */\n if (typeof Tether === 'undefined') {\n throw new Error('Bootstrap tooltips require Tether (http://tether.io/)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tether'\n\n const Default = {\n animation : true,\n template : '
'\n + '
',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : '0 0',\n constraints : [],\n container : false\n }\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : 'string',\n constraints : 'array',\n container : '(string|element|boolean)'\n }\n\n const AttachmentMap = {\n TOP : 'bottom center',\n RIGHT : 'middle left',\n BOTTOM : 'top center',\n LEFT : 'middle right'\n }\n\n const HoverState = {\n SHOW : 'show',\n OUT : 'out'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const TetherClass = {\n element : false,\n enabled : false\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._isTransitioning = false\n this._tether = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n\n } else {\n\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n this.cleanupTether()\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n this._tether = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n if (this._isTransitioning) {\n throw new Error('Tooltip is transitioning')\n }\n $(this.element).trigger(showEvent)\n\n const isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n const attachment = this._getAttachment(placement)\n\n const container = this.config.container === false ? document.body : $(this.config.container)\n\n $(tip)\n .data(this.constructor.DATA_KEY, this)\n .appendTo(container)\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._tether = new Tether({\n attachment,\n element : tip,\n target : this.element,\n classes : TetherClass,\n classPrefix : CLASS_PREFIX,\n offset : this.config.offset,\n constraints : this.config.constraints,\n addTargetClasses: false\n })\n\n Util.reflow(tip)\n this._tether.position()\n\n $(tip).addClass(ClassName.SHOW)\n\n const complete = () => {\n const prevHoverState = this._hoverState\n this._hoverState = null\n this._isTransitioning = false\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n return\n }\n\n complete()\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n if (this._isTransitioning) {\n throw new Error('Tooltip is transitioning')\n }\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n this._isTransitioning = false\n this.cleanupTether()\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if (Util.supportsTransitionEnd() &&\n $(this.tip).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n\n // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n\n this.cleanupTether()\n }\n\n setElementContent($element, content) {\n const html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n cleanupTether() {\n if (this._tether) {\n this._tether.destroy()\n }\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSELEAVE :\n this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => this.hide()\n )\n })\n\n if (this.config.selector) {\n this.config = $.extend({}, this.config, {\n trigger : 'manual',\n selector : ''\n })\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n if (this.element.getAttribute('title') ||\n titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||\n context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n config = $.extend(\n {},\n this.constructor.Default,\n $(this.element).data(),\n config\n )\n\n if (config.delay && typeof config.delay === 'number') {\n config.delay = {\n show : config.delay,\n hide : config.delay\n }\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tooltip._jQueryInterface\n $.fn[NAME].Constructor = Tooltip\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n }\n\n return Tooltip\n\n})(jQuery)\n\nexport default Tooltip\n"]} \ No newline at end of file +{"version":3,"sources":["../src/tooltip.js"],"names":["Tooltip","$","Tether","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","CLASS_PREFIX","Default","animation","template","trigger","title","delay","html","selector","placement","offset","constraints","container","DefaultType","AttachmentMap","TOP","RIGHT","BOTTOM","LEFT","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","TetherClass","element","enabled","Trigger","HOVER","FOCUS","MANUAL","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_tether","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","cleanupTether","removeData","off","closest","remove","show","css","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","document","body","appendTo","target","classes","classPrefix","addTargetClasses","reflow","position","complete","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","hide","callback","hideEvent","parentNode","removeChild","removeAttribute","removeClass","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","destroy","toUpperCase","triggers","split","forEach","on","eventIn","eventOut","extend","_fixTitle","titleType","type","setTimeout","typeCheckConfig","key","_jQueryInterface","each","_config","test","undefined","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAEtB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAGD;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBP,EAAEQ,EAAF,CAAKL,IAAL,CAA5B;AACA,MAAMM,sBAAsB,GAA5B;AACA,MAAMC,eAAsB,WAA5B;;AAEA,MAAMC,UAAU;AACdC,eAAc,IADA;AAEdC,cAAc,yCACA,yCAHA;AAIdC,aAAc,aAJA;AAKdC,WAAc,EALA;AAMdC,WAAc,CANA;AAOdC,UAAc,KAPA;AAQdC,cAAc,KARA;AASdC,eAAc,KATA;AAUdC,YAAc,KAVA;AAWdC,iBAAc,EAXA;AAYdC,eAAc;AAZA,GAAhB;;AAeA,MAAMC,cAAc;AAClBX,eAAc,SADI;AAElBC,cAAc,QAFI;AAGlBE,WAAc,2BAHI;AAIlBD,aAAc,QAJI;AAKlBE,WAAc,iBALI;AAMlBC,UAAc,SANI;AAOlBC,cAAc,kBAPI;AAQlBC,eAAc,mBARI;AASlBC,YAAc,QATI;AAUlBC,iBAAc,OAVI;AAWlBC,eAAc;AAXI,GAApB;;AAcA,MAAME,gBAAgB;AACpBC,SAAS,eADW;AAEpB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eAAOR,IAAP;AACD;AA7ImB;AAAA;AAAA,0BA+IE;AACpB,eAAOE,QAAP;AACD;AAjJmB;AAAA;AAAA,0BAmJD;AACjB,eAAO2B,KAAP;AACD;AArJmB;AAAA;AAAA,0BAuJG;AACrB,eAAO1B,SAAP;AACD;AAzJmB;AAAA;AAAA,0BA2JK;AACvB,eAAOiB,WAAP;AACD;AA7JmB;;AAAA;AAAA;;AA6nBtB;;;;;;AAMAvB,IAAEQ,EAAF,CAAKL,IAAL,IAAyBJ,QAAQ+J,gBAAjC;AACA9J,IAAEQ,EAAF,CAAKL,IAAL,EAAWgK,WAAX,GAAyBpK,OAAzB;AACAC,IAAEQ,EAAF,CAAKL,IAAL,EAAWiK,UAAX,GAAyB,YAAY;AACnCpK,MAAEQ,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAOR,QAAQ+J,gBAAf;AACD,GAHD;;AAKA,SAAO/J,OAAP;AAED,CA5oBe,CA4oBbsK,MA5oBa,CAAhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Tether */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Tether dependency\n * Tether - http://tether.io/\n */\n if (typeof Tether === 'undefined') {\n throw new Error('Bootstrap tooltips require Tether (http://tether.io/)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tether'\n\n const Default = {\n animation : true,\n template : '
'\n + '
',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : '0 0',\n constraints : [],\n container : false\n }\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : 'string',\n constraints : 'array',\n container : '(string|element|boolean)'\n }\n\n const AttachmentMap = {\n TOP : 'bottom center',\n RIGHT : 'middle left',\n BOTTOM : 'top center',\n LEFT : 'middle right'\n }\n\n const HoverState = {\n SHOW : 'show',\n OUT : 'out'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const TetherClass = {\n element : false,\n enabled : false\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._tether = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n\n } else {\n\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n this.cleanupTether()\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n this._tether = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n const attachment = this._getAttachment(placement)\n\n const container = this.config.container === false ? document.body : $(this.config.container)\n\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._tether = new Tether({\n attachment,\n element : tip,\n target : this.element,\n classes : TetherClass,\n classPrefix : CLASS_PREFIX,\n offset : this.config.offset,\n constraints : this.config.constraints,\n addTargetClasses: false\n })\n\n Util.reflow(tip)\n this._tether.position()\n\n $(tip).addClass(ClassName.SHOW)\n\n const complete = () => {\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n return\n }\n\n complete()\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n this.cleanupTether()\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if (Util.supportsTransitionEnd() &&\n $(this.tip).hasClass(ClassName.FADE)) {\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n\n // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n\n this.cleanupTether()\n }\n\n setElementContent($element, content) {\n const html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n cleanupTether() {\n if (this._tether) {\n this._tether.destroy()\n }\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSELEAVE :\n this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => this.hide()\n )\n })\n\n if (this.config.selector) {\n this.config = $.extend({}, this.config, {\n trigger : 'manual',\n selector : ''\n })\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n if (this.element.getAttribute('title') ||\n titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||\n context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n config = $.extend(\n {},\n this.constructor.Default,\n $(this.element).data(),\n config\n )\n\n if (config.delay && typeof config.delay === 'number') {\n config.delay = {\n show : config.delay,\n hide : config.delay\n }\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tooltip._jQueryInterface\n $.fn[NAME].Constructor = Tooltip\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n }\n\n return Tooltip\n\n})(jQuery)\n\nexport default Tooltip\n"]} \ No newline at end of file diff --git a/js/dist/util.js b/js/dist/util.js index 2fda21d535..6eadcc31b9 100644 --- a/js/dist/util.js +++ b/js/dist/util.js @@ -111,13 +111,16 @@ var Util = function ($) { }, getSelectorFromElement: function getSelectorFromElement(element) { var 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 { + var $selector = $(selector); + return $selector.length > 0 ? selector : null; + } catch (error) { + return null; + } }, reflow: function reflow(element) { return element.offsetHeight; diff --git a/js/dist/util.js.map b/js/dist/util.js.map index b9d4790880..011bc69b8b 100644 --- a/js/dist/util.js.map +++ b/js/dist/util.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/util.js"],"names":["Util","$","transition","MAX_UID","TransitionEndEvent","WebkitTransition","MozTransition","OTransition","toType","obj","toString","call","match","toLowerCase","isElement","nodeType","getSpecialTransitionEndEvent","bindType","end","delegateType","handle","event","target","is","handleObj","handler","apply","arguments","undefined","transitionEndTest","window","QUnit","el","document","createElement","name","style","transitionEndEmulator","duration","called","one","TRANSITION_END","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","supportsTransitionEnd","special","getUID","prefix","Math","random","getElementById","getSelectorFromElement","element","selector","getAttribute","test","reflow","offsetHeight","trigger","Boolean","typeCheckConfig","componentName","config","configTypes","property","hasOwnProperty","expectedTypes","value","valueType","RegExp","Error","toUpperCase","jQuery"],"mappings":"AAAA;;;;;;;AAOA,IAAMA,OAAQ,UAACC,CAAD,EAAO;;AAGnB;;;;;;AAMA,MAAIC,aAAa,KAAjB;;AAEA,MAAMC,UAAU,OAAhB;;AAEA,MAAMC,qBAAqB;AACzBC,sBAAmB,qBADM;AAEzBC,mBAAmB,eAFM;AAGzBC,iBAAmB,+BAHM;AAIzBL,gBAAmB;AAJM,GAA3B;;AAOA;AACA,WAASM,MAAT,CAAgBC,GAAhB,EAAqB;AACnB,WAAO,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,eAA5B,EAA6C,CAA7C,EAAgDC,WAAhD,EAAP;AACD;;AAED,WAASC,SAAT,CAAmBL,GAAnB,EAAwB;AACtB,WAAO,CAACA,IAAI,CAAJ,KAAUA,GAAX,EAAgBM,QAAvB;AACD;;AAED,WAASC,4BAAT,GAAwC;AACtC,WAAO;AACLC,gBAAUf,WAAWgB,GADhB;AAELC,oBAAcjB,WAAWgB,GAFpB;AAGLE,YAHK,kBAGEC,KAHF,EAGS;AACZ,YAAIpB,EAAEoB,MAAMC,MAAR,EAAgBC,EAAhB,CAAmB,IAAnB,CAAJ,EAA8B;AAC5B,iBAAOF,MAAMG,SAAN,CAAgBC,OAAhB,CA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AvJU,CAAb","file":"util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transition = false\n\n const MAX_UID = 1000000\n\n const TransitionEndEvent = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n // shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\n }\n\n function isElement(obj) {\n return (obj[0] || obj).nodeType\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: transition.end,\n delegateType: transition.end,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined\n }\n }\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n const el = document.createElement('bootstrap')\n\n for (const name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return {\n end: TransitionEndEvent[name]\n }\n }\n }\n\n return false\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n transition = transitionEndTest()\n\n $.fn.emulateTransitionEnd = transitionEndEmulator\n\n if (Util.supportsTransitionEnd()) {\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n }\n\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n const Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector) {\n selector = element.getAttribute('href') || ''\n selector = /^#[a-z]/i.test(selector) ? selector : null\n }\n\n return selector\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(transition.end)\n },\n\n supportsTransitionEnd() {\n return Boolean(transition)\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (configTypes.hasOwnProperty(property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n }\n }\n\n setTransitionEndSupport()\n\n return Util\n\n})(jQuery)\n\nexport default Util\n"]} \ No newline at end of file +{"version":3,"sources":["../src/util.js"],"names":["Util","$","transition","MAX_UID","TransitionEndEvent","WebkitTransition","MozTransition","OTransition","toType","obj","toString","call","match","toLowerCase","isElement","nodeType","getSpecialTransitionEndEvent","bindType","end","delegateType","handle","event","target","is","handleObj","handler","apply","arguments","undefined","transitionEndTest","window","QUnit","el","document","createElement","name","style","transitionEndEmulator","duration","called","one","TRANSITION_END","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","supportsTransitionEnd","special","getUID","prefix","Math","random","getElementById","getSelectorFromElement","element","selector","getAttribute","$selector","length","error","reflow","offsetHeight","trigger","Boolean","typeCheckConfig","componentName","config","configTypes","property","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","jQuery"],"mappings":"AAAA;;;;;;;AAOA,IAAMA,OAAQ,UAACC,CAAD,EAAO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5BU;AA8BXnB,wBA9BW,gCA8BUY,OA9BV,EA8BmB;AAC5BtD,QAAEsD,OAAF,EAAWQ,OAAX,CAAmB7D,WAAWgB,GAA9B;AACD,KAhCU;AAkCX6B,yBAlCW,mCAkCa;AACtB,aAAOiB,QAAQ9D,UAAR,CAAP;AACD,KApCU;AAsCX+D,mBAtCW,2BAsCKC,aAtCL,EAsCoBC,MAtCpB,EAsC4BC,WAtC5B,EAsCyC;AAClD,WAAK,IAAMC,QAAX,IAAuBD,WAAvB,EAAoC;AAClC,YAAIA,YAAYE,cAAZ,CAA2BD,QAA3B,CAAJ,EAA0C;AACxC,cAAME,gBAAgBH,YAAYC,QAAZ,CAAtB;AACA,cAAMG,QAAgBL,OAAOE,QAAP,CAAtB;AACA,cAAMI,YAAgBD,SAAS1D,UAAU0D,KAAV,CAAT,GACA,SADA,GACYhE,OAAOgE,KAAP,CADlC;;AAGA,cAAI,CAAC,IAAIE,MAAJ,CAAWH,aAAX,EAA0BI,IAA1B,CAA+BF,SAA/B,CAAL,EAAgD;AAC9C,kBAAM,IAAIG,KAAJ,CACDV,cAAcW,WAAd,EAAH,wBACWR,QADX,yBACuCI,SADvC,oCAEsBF,aAFtB,QADI,CAAN;AAID;AACF;AACF;AACF;AAtDU,GAAb;;AAyDA3B;;AAEA,SAAO5C,IAAP;AAED,CA1JY,CA0JV8E,MA1JU,CAAb","file":"util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transition = false\n\n const MAX_UID = 1000000\n\n const TransitionEndEvent = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n // shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\n }\n\n function isElement(obj) {\n return (obj[0] || obj).nodeType\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: transition.end,\n delegateType: transition.end,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined\n }\n }\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n const el = document.createElement('bootstrap')\n\n for (const name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return {\n end: TransitionEndEvent[name]\n }\n }\n }\n\n return false\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n transition = transitionEndTest()\n\n $.fn.emulateTransitionEnd = transitionEndEmulator\n\n if (Util.supportsTransitionEnd()) {\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n }\n\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n const Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || ''\n }\n\n try {\n const $selector = $(selector)\n return $selector.length > 0 ? selector : null\n } catch (error) {\n return null\n }\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(transition.end)\n },\n\n supportsTransitionEnd() {\n return Boolean(transition)\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (configTypes.hasOwnProperty(property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n }\n }\n\n setTransitionEndSupport()\n\n return Util\n\n})(jQuery)\n\nexport default Util\n"]} \ No newline at end of file diff --git a/js/src/carousel.js b/js/src/carousel.js index 8a75cb240e..7c2da45ad7 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) { @@ -282,9 +280,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 +312,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 +357,9 @@ const Carousel = (($) => { const slidEvent = $.Event(Event.SLID, { relatedTarget: nextElement, - direction: eventDirectionName + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex }) if (Util.supportsTransitionEnd() && diff --git a/js/src/collapse.js b/js/src/collapse.js index 8154b104de..a1896cecbb 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -57,7 +57,8 @@ const Collapse = (($) => { const Selector = { ACTIVES : '.card:not(.multi) > .show, .card:not(.multi) > .collapsing', // boosted mod - DATA_TOGGLE : '[data-toggle="collapse"]' + DATA_TOGGLE : '[data-toggle="collapse"]', + DATA_CHILDREN : 'data-children' } @@ -77,13 +78,20 @@ 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) { 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() } @@ -112,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 } @@ -124,7 +129,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 } @@ -196,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 } @@ -211,10 +213,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) @@ -380,7 +380,9 @@ const Collapse = (($) => { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + if (!/input|textarea/i.test(event.target.tagName)) { event.preventDefault() + } const target = Collapse._getTargetFromElement(this) const data = $(target).data(DATA_KEY) diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 66b6080c84..df3dfd2a90 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -133,13 +133,16 @@ const ScrollSpy = (($) => { target = $(targetSelector)[0] } - if (target && (target.offsetWidth || target.offsetHeight)) { + 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 }) .filter((item) => item) @@ -198,7 +201,7 @@ const ScrollSpy = (($) => { _getOffsetHeight() { return this._scrollElement === window ? - window.innerHeight : this._scrollElement.offsetHeight + window.innerHeight : this._scrollElement.getBoundingClientRect().height } _process() { diff --git a/js/src/tooltip.js b/js/src/tooltip.js index e750dceccf..c25fd7317c 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -127,7 +127,6 @@ const Tooltip = (($) => { this._timeout = 0 this._hoverState = '' this._activeTrigger = {} - this._isTransitioning = false this._tether = null // protected @@ -249,9 +248,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( @@ -283,9 +279,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,7 +306,6 @@ const Tooltip = (($) => { const complete = () => { const prevHoverState = this._hoverState this._hoverState = null - this._isTransitioning = false $(this.element).trigger(this.constructor.Event.SHOWN) @@ -318,7 +315,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) @@ -332,9 +328,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) @@ -342,7 +335,6 @@ const Tooltip = (($) => { this.element.removeAttribute('aria-describedby') $(this.element).trigger(this.constructor.Event.HIDDEN) - this._isTransitioning = false this.cleanupTether() if (callback) { @@ -364,7 +356,7 @@ const Tooltip = (($) => { if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true + $(tip) .one(Util.TRANSITION_END, complete) .emulateTransitionEnd(TRANSITION_DURATION) diff --git a/js/src/util.js b/js/src/util.js index 515eba6d9b..3c0d022513 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) {