From ae50bb784506b4aa6b79598c2000c1d20843b5fd Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 18 Mar 2017 18:47:57 -0700 Subject: [PATCH] grunt --- js/dist/modal.js | 2 +- js/dist/modal.js.map | 2 +- js/dist/scrollspy.js | 11 +++++++---- js/dist/scrollspy.js.map | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/js/dist/modal.js b/js/dist/modal.js index 73d203eda0..8138f19490 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -436,7 +436,7 @@ var Modal = function ($) { var scrollDiv = document.createElement('div'); scrollDiv.className = ClassName.SCROLLBAR_MEASURER; document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; }; diff --git a/js/dist/modal.js.map b/js/dist/modal.js.map index d4b739b0d9..9a34bd6a32 100644 --- a/js/dist/modal.js.map +++ b/js/dist/modal.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal.js"],"names":["Modal","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","BACKDROP_TRANSITION_DURATION","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","element","config","_config","_getConfig","_element","_dialog","find","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_isTransitioning","_originalBodyPadding","_scrollbarWidth","toggle","relatedTarget","hide","Error","Util","supportsTransitionEnd","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","transition","hideEvent","off","removeClass","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","removeData","window","extend","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","_handleUpdate","setAttribute","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","doAnimate","createElement","className","appendTo","currentTarget","callbackRemove","_adjustDialog","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","clientWidth","innerWidth","_getScrollbarWidth","bodyPadding","parseInt","css","scrollDiv","scrollbarWidth","offsetWidth","removeChild","_jQueryInterface","each","data","undefined","selector","getSelectorFromElement","tagName","$target","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,QAAS,UAACC,CAAD,EAAO;;AAGpB;;;;;;AAMA,MAAMC,OAA+B,OAArC;AACA,MAAMC,UAA+B,eAArC;AACA,MAAMC,WAA+B,UAArC;AACA,MAAMC,kBAAmCD,QAAzC;AACA,MAAME,eAA+B,WAArC;AACA,MAAMC,qBAA+BN,EAAEO,EAAF,CAAKN,IAAL,CAArC;AACA,MAAMO,sBAA+B,GAArC;AACA,MAAMC,+BAA+B,GAArC;AACA,MAAMC,iBAA+B,EAArC,CAjBoB,CAiBoB;;AAExC,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,IAHG;AAIdC,UAAW;AAJG,GAAhB;;AAOA,MAAMC,cAAc;AAClBJ,cAAW,kBADO;AAElBC,cAAW,SAFO;AAGlBC,WAAW,SAHO;AAIlBC,UAAW;AAJO,GAApB;;AAOA,MAAME,QAAQ;AACZC,mBAA2Bd,SADf;AAEZe,uBAA6Bf,SAFjB;AAGZgB,mBAA2BhB,SAHf;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D;;AAED,QAAMrG,SAASxC,EAAEyE,MAAF,EAAUkE,IAAV,CAAexI,QAAf,IACb,QADa,GACFH,EAAEwF,MAAF,CAAS,EAAT,EAAaxF,EAAEyE,MAAF,EAAUkE,IAAV,EAAb,EAA+B3I,EAAE,IAAF,EAAQ2I,IAAR,EAA/B,CADb;;AAGA,QAAI,KAAKI,OAAL,KAAiB,GAAjB,IAAwB,KAAKA,OAAL,KAAiB,MAA7C,EAAqD;AACnDxE,YAAMM,cAAN;AACD;;AAED,QAAMmE,UAAUhJ,EAAEyE,MAAF,EAAUD,GAAV,CAAcvD,MAAMG,IAApB,EAA0B,UAACwC,SAAD,EAAe;AACvD,UAAIA,UAAUE,kBAAV,EAAJ,EAAoC;AAClC;AACA;AACD;;AAEDkF,cAAQxE,GAAR,CAAYvD,MAAME,MAAlB,EAA0B,YAAM;AAC9B,YAAInB,UAAQ0E,EAAR,CAAW,UAAX,CAAJ,EAA4B;AAC1B,iBAAK5D,KAAL;AACD;AACF,OAJD;AAKD,KAXe,CAAhB;;AAaAf,UAAM0I,gBAAN,CAAuBQ,IAAvB,CAA4BjJ,EAAEyE,MAAF,CAA5B,EAAuCjC,MAAvC,EAA+C,IAA/C;AACD,GA7BD;;AAgCA;;;;;;AAMAxC,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,MAAM0I,gBAA/B;AACAzI,IAAEO,EAAF,CAAKN,IAAL,EAAWiJ,WAAX,GAAyBnJ,KAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWkJ,UAAX,GAAyB,YAAY;AACnCnJ,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,MAAM0I,gBAAb;AACD,GAHD;;AAKA,SAAO1I,KAAP;AAED,CAphBa,CAohBXqJ,MAphBW,CAAd","file":"modal.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Modal = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'modal'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.modal'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 300\n const BACKDROP_TRANSITION_DURATION = 150\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\n const Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n }\n\n const DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\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 FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal {\n\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = $(element).find(Selector.DIALOG)[0]\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._originalBodyPadding = 0\n this._scrollbarWidth = 0\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(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isTransitioning) {\n throw new Error('Modal is transitioning')\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n $(document.body).addClass(ClassName.OPEN)\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (this._isTransitioning) {\n throw new Error('Modal is transitioning')\n }\n\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n if (transition) {\n this._isTransitioning = true\n }\n\n const hideEvent = $.Event(Event.HIDE)\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (transition) {\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window, document, this._element, this._backdrop).off(EVENT_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._originalBodyPadding = null\n this._scrollbarWidth = 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 _showElement(relatedTarget) {\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // don't move modals dom position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.scrollTop = 0\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n !$(this._element).has(event.target).length) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n this.hide()\n }\n })\n\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this._handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', 'true')\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n const doAnimate = Util.supportsTransitionEnd() && animate\n\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n $(this._backdrop).addClass(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (doAnimate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!doAnimate) {\n callback()\n return\n }\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n } else {\n callbackRemove()\n }\n\n } else if (callback) {\n callback()\n }\n }\n\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _handleUpdate() {\n this._adjustDialog()\n }\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n this._isBodyOverflowing = document.body.clientWidth < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n const bodyPadding = parseInt(\n $(Selector.FIXED_CONTENT).css('padding-right') || 0,\n 10\n )\n\n this._originalBodyPadding = document.body.style.paddingRight || ''\n\n if (this._isBodyOverflowing) {\n document.body.style.paddingRight =\n `${bodyPadding + this._scrollbarWidth}px`\n }\n }\n\n _resetScrollbar() {\n document.body.style.paddingRight = this._originalBodyPadding\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n\n // static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend(\n {},\n Modal.Default,\n $(this).data(),\n typeof config === 'object' && config\n )\n\n if (!data) {\n data = new Modal(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](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n const config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface\n $.fn[NAME].Constructor = Modal\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n }\n\n return Modal\n\n})(jQuery)\n\nexport default Modal\n"]} \ No newline at end of file +{"version":3,"sources":["../src/modal.js"],"names":["Modal","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","BACKDROP_TRANSITION_DURATION","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","element","config","_config","_getConfig","_element","_dialog","find","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_isTransitioning","_originalBodyPadding","_scrollbarWidth","toggle","relatedTarget","hide","Error","Util","supportsTransitionEnd","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","transition","hideEvent","off","removeClass","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","removeData","window","extend","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","_handleUpdate","setAttribute","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","doAnimate","createElement","className","appendTo","currentTarget","callbackRemove","_adjustDialog","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","clientWidth","innerWidth","_getScrollbarWidth","bodyPadding","parseInt","css","scrollDiv","scrollbarWidth","getBoundingClientRect","width","removeChild","_jQueryInterface","each","data","undefined","selector","getSelectorFromElement","tagName","$target","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,QAAS,UAACC,CAAD,EAAO;;AAGpB;;;;;;AAMA,MAAMC,OAA+B,OAArC;AACA,MAAMC,UAA+B,eAArC;AACA,MAAMC,WAA+B,UAArC;AACA,MAAMC,kBAAmCD,QAAzC;AACA,MAAME,eAA+B,WAArC;AACA,MAAMC,qBAA+BN,EAAEO,EAAF,CAAKN,IAAL,CAArC;AACA,MAAMO,sBAA+B,GAArC;AACA,MAAMC,+BAA+B,GAArC;AACA,MAAMC,iBAA+B,EAArC,CAjBoB,CAiBoB;;AAExC,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAF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,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,MAAM2I,gBAAb;AACD,GAHD;;AAKA,SAAO3I,KAAP;AAED,CAphBa,CAohBXsJ,MAphBW,CAAd","file":"modal.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Modal = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'modal'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.modal'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 300\n const BACKDROP_TRANSITION_DURATION = 150\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\n const Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n }\n\n const DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\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 FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal {\n\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = $(element).find(Selector.DIALOG)[0]\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._originalBodyPadding = 0\n this._scrollbarWidth = 0\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(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isTransitioning) {\n throw new Error('Modal is transitioning')\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n $(document.body).addClass(ClassName.OPEN)\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (this._isTransitioning) {\n throw new Error('Modal is transitioning')\n }\n\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n if (transition) {\n this._isTransitioning = true\n }\n\n const hideEvent = $.Event(Event.HIDE)\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (transition) {\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window, document, this._element, this._backdrop).off(EVENT_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._originalBodyPadding = null\n this._scrollbarWidth = 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 _showElement(relatedTarget) {\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // don't move modals dom position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.scrollTop = 0\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n !$(this._element).has(event.target).length) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n this.hide()\n }\n })\n\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this._handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', 'true')\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n const doAnimate = Util.supportsTransitionEnd() && animate\n\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n $(this._backdrop).addClass(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (doAnimate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!doAnimate) {\n callback()\n return\n }\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n } else {\n callbackRemove()\n }\n\n } else if (callback) {\n callback()\n }\n }\n\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _handleUpdate() {\n this._adjustDialog()\n }\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n this._isBodyOverflowing = document.body.clientWidth < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n const bodyPadding = parseInt(\n $(Selector.FIXED_CONTENT).css('padding-right') || 0,\n 10\n )\n\n this._originalBodyPadding = document.body.style.paddingRight || ''\n\n if (this._isBodyOverflowing) {\n document.body.style.paddingRight =\n `${bodyPadding + this._scrollbarWidth}px`\n }\n }\n\n _resetScrollbar() {\n document.body.style.paddingRight = this._originalBodyPadding\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n\n // static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend(\n {},\n Modal.Default,\n $(this).data(),\n typeof config === 'object' && config\n )\n\n if (!data) {\n data = new Modal(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](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n const config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface\n $.fn[NAME].Constructor = Modal\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n }\n\n return Modal\n\n})(jQuery)\n\nexport default Modal\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..132a267187 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,mBAAgB,eAFA;AAGhBC,cAAgB,UAHA;AAIhBC,SAAgB,KAJA;AAKhBC,YAAgB;AALA,GAAlB;;AAQA,MAAMC,WAAW;AACfC,cAAkB,qBADH;AAEfF,YAAkB,SAFH;AAGfG,eAAkB,YAHH;AAIfC,QAAkB,IAJH;AAKfC,iBAAkB,aALH;AAMfC,eAAkB,WANH;AAOfC,cAAkB,WAPH;AAQfC,oBAAkB,gBARH;AASfC,qBAAkB;AATH,GAAjB;;AAYA,MAAMC,eAAe;AACnBC,YAAW,QADQ;AAEnBC,cAAW;AAFQ,GAArB;;AAMA;;;;;;AA5DwB,MAkElBnC,SAlEkB;AAoEtB,u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AR,CAAa9G,QAAb,EAAuB8G,IAAvB;AACD;;AAED,YAAI,OAAO7E,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,cAAI6E,KAAK7E,MAAL,MAAiB6D,SAArB,EAAgC;AAC9B,kBAAM,IAAIiB,KAAJ,uBAA8B9E,MAA9B,OAAN;AACD;AACD6E,eAAK7E,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KA1RqB;;AAAA;AAAA;AAAA,0BAwFD;AACnB,eAAOlC,OAAP;AACD;AA1FqB;AAAA;AAAA,0BA4FD;AACnB,eAAOM,OAAP;AACD;AA9FqB;;AAAA;AAAA;;AAgSxB;;;;;;AAMAR,IAAEwC,MAAF,EAAUQ,EAAV,CAAanC,MAAMG,aAAnB,EAAkC,YAAM;AACtC,QAAMmG,aAAanH,EAAE0D,SAAF,CAAY1D,EAAEuB,SAASC,QAAX,CAAZ,CAAnB;;AAEA,SAAK,IAAIuE,IAAIoB,WAAWvB,MAAxB,EAAgCG,GAAhC,GAAsC;AACpC,UAAMqB,OAAOpH,EAAEmH,WAAWpB,CAAX,CAAF,CAAb;AACAhG,gBAAUgH,gBAAV,CAA2BM,IAA3B,CAAgCD,IAAhC,EAAsCA,KAAKH,IAAL,EAAtC;AACD;AACF,GAPD;;AAUA;;;;;;AAMAjH,IAAEO,EAAF,CAAKN,IAAL,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;AAIfC,QAAkB,IAJH;AAKfC,iBAAkB,aALH;AAMfC,eAAkB,WANH;AAOfC,cAAkB,WAPH;AAQfC,oBAAkB,gBARH;AASfC,qBAAkB;AATH,GAAjB;;AAYA,MAAMC,eAAe;AACnBC,YAAW,QADQ;AAEnBC,cAAW;AAFQ,GAArB;;AAMA;;;;;;AA5DwB,MAkElBnC,SAlEkB;AAoEtB,uBAAYoC,OAAZ,EAAqBC,MAArB,EAA6B;AAAA;;AAAA;;AAC3B,WAAKC,QAAL,GAAsBF,OAAtB;AACA,WAAKG,cAAL,GAAsBH,QAAQI,OAAR,KAAoB,MAApB,GAA6BC,MAA7B,GAAs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;AAC9B,cAAI+E,KAAK/E,MAAL,MAAiB+D,SAArB,EAAgC;AAC9B,kBAAM,IAAIiB,KAAJ,uBAA8BhF,MAA9B,OAAN;AACD;AACD+E,eAAK/E,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KA7RqB;;AAAA;AAAA;AAAA,0BAwFD;AACnB,eAAOlC,OAAP;AACD;AA1FqB;AAAA;AAAA,0BA4FD;AACnB,eAAOM,OAAP;AACD;AA9FqB;;AAAA;AAAA;;AAmSxB;;;;;;AAMAR,IAAEwC,MAAF,EAAUQ,EAAV,CAAanC,MAAMG,aAAnB,EAAkC,YAAM;AACtC,QAAMqG,aAAarH,EAAE0D,SAAF,CAAY1D,EAAEuB,SAASC,QAAX,CAAZ,CAAnB;;AAEA,SAAK,IAAIyE,IAAIoB,WAAWvB,MAAxB,EAAgCG,GAAhC,GAAsC;AACpC,UAAMqB,OAAOtH,EAAEqH,WAAWpB,CAAX,CAAF,CAAb;AACAlG,gBAAUkH,gBAAV,CAA2BM,IAA3B,CAAgCD,IAAhC,EAAsCA,KAAKH,IAAL,EAAtC;AACD;AACF,GAPD;;AAUA;;;;;;AAMAnH,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,UAAUkH,gBAAnC;AACAjH,IAAEO,EAAF,CAAKN,IAAL,EAAWuH,WAAX,GAAyBzH,SAAzB;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