From 3c916eee5ad967cc9381c3cb809c77262e475aa8 Mon Sep 17 00:00:00 2001 From: Mauricio Dziedzinski Date: Mon, 20 Aug 2018 01:05:02 +0200 Subject: [PATCH] Refactor scrollAffix logic, fix issues when changing scroll position manually --- dist/vue-affix.min.js | 265 +++++++++++++++++++++++++++++++++++++++++- src/affix.vue | 158 ++++++++++++++----------- 2 files changed, 352 insertions(+), 71 deletions(-) diff --git a/dist/vue-affix.min.js b/dist/vue-affix.min.js index d3c1df4..bd7248b 100644 --- a/dist/vue-affix.min.js +++ b/dist/vue-affix.min.js @@ -1 +1,264 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["vue-affix"]=e():t.vueAffix=e()}(window,function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(o,s,function(e){return t[e]}.bind(null,s));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=1)}([function(t,e,i){var o=i(3);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,i(6).default)("da410cd4",o,!1,{})},function(t,e,i){t.exports=i(5)},function(t,e,i){"use strict";var o=i(0);i.n(o).a},function(t,e,i){(t.exports=i(4)(!1)).push([t.i,"\n.vue-affix {\n position: relative;\n}\n.affix {\n position: fixed;\n}\n.affix-bottom {\n position: relative;\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=function(t,e){var i=t[1]||"",o=t[3];if(!o)return i;if(e&&"function"==typeof btoa){var s=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(o),n=o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"});return[i].concat(n).concat([s]).join("\n")}return[i].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},s=0;s=this.relativeElement.offsetHeight||this.handleAffix()):this.removeClasses()},handleAffix:function(){if(this.scrollAffix&&this.affixHeight>window.innerHeight)return this.setScrollingDirection(),"scrollaffix-top"===this.currentScrollAffix&&this.distanceFromTop+this.offset.top>=this.affixInitialTop&&this.setScrollAffixScrolling(),this.scrollingDown&&"scrollaffix-scrolling"===this.currentScrollAffix&&this.screenBottomPos>=this.affixBottomPos+this.offset.bottom&&this.screenBottomPos=this.relativeElmBottomPos+this.offset.bottom&&this.setScrollAffixBottom(),"scrollaffix-bottom"===this.currentScrollAffix&&this.screenBottomPos=this.relativeElmOffsetTop-this.offset.top&&this.relativeElmBottomPos-this.offset.bottom>=this.distanceFromTop+this.topPadding+this.affixHeight+this.offset.top&&this.setAffix(),this.relativeElmBottomPos-this.offset.bottom=this.affixBottomPos+this.offset.bottom&&this.screenBottomPos=this.relativeElmBottomPos?this.setScrollAffixBottom():this.setScrollAffixScrolling()},setScrollAffixScrolling:function(){this.currentScrollAffix="scrollaffix-scrolling",this.$el.style.top="".concat(this.affixRect.top+this.distanceFromTop-this.affixInitialTop,"px"),this.$el.style.bottom="auto",this.removeClasses(),this.emitEvent()},setScrollAffixUp:function(){this.currentScrollAffix="scrollaffix-up",this.currentScrollAffix!==this.lastState&&(this.$el.style.top="".concat(this.topPadding+this.offset.top,"px"),this.$el.style.bottom="auto",this.removeClasses(),this.emitEvent(),this.$el.classList.add("affix"))},setScrollAffixDown:function(){this.currentScrollAffix="scrollaffix-down",this.currentScrollAffix!==this.lastState&&(this.$el.style.bottom="".concat(this.offset.bottom,"px"),this.$el.style.top="auto",this.removeClasses(),this.emitEvent(),this.$el.classList.add("affix"))},setScrollAffixTop:function(){this.currentScrollAffix="scrollaffix-top",this.$el.style.top=0,this.$el.style.bottom="auto",this.removeClasses(),this.emitEvent()},setScrollAffixBottom:function(){this.currentScrollAffix="scrollaffix-bottom",this.$el.style.top="".concat(this.relativeElmBottomPos-this.affixInitialTop-this.affixHeight,"px"),this.$el.style.bottom="auto",this.removeClasses(),this.emitEvent()},setScrollingDirection:function(){this.distanceFromTop>this.lastDistanceFromTop?(this.scrollingDown=!0,this.scrollingUp=!1):(this.scrollingUp=!0,this.scrollingDown=!1)},setAffixTop:function(){this.currentState="affix-top",this.currentState!==this.lastState&&(this.emitEvent(),this.removeClasses(),this.$el.classList.remove("affix"),this.$el.classList.add("affix-top"),this.$el.style.top=null)},setAffix:function(){this.currentState="affix",this.$el.style.top="".concat(this.topPadding+this.offset.top,"px"),this.currentState!==this.lastState&&(this.emitEvent(),this.removeClasses(),this.$el.classList.add("affix"))},setAffixBottom:function(){this.currentState="affix-bottom",this.$el.style.top="".concat(this.relativeElement.offsetHeight-this.affixHeight-this.offset.bottom-this.topPadding,"px"),this.currentState!==this.lastState&&(this.emitEvent(),this.removeClasses(),this.$el.classList.add("affix-bottom"))},removeClasses:function(){this.$el.classList.remove("affix-top"),this.$el.classList.remove("affix"),this.$el.classList.remove("affix-bottom")},emitEvent:function(){this.scrollAffix&&this.lastScrollAffixState&&this.$emit(this.currentScrollAffix.replace("-","")),this.lastState&&this.$emit(this.currentState.replace("-",""))},getOffsetTop:function(t){for(var e=0,i=t;i;)e+=i.offsetTop,i=i.offsetParent;return e}},mounted:function(){this.$el.classList.add("vue-affix"),this.affixInitialTop=this.getOffsetTop(this.$el),this.topPadding=this.affixInitialTop-this.getOffsetTop(this.relativeElement),this.updateData(),this.scrollAffix&&this.initScrollAffix(),this.onScroll(),window.addEventListener("scroll",this.onScroll)},beforeDestroy:function(){window.removeEventListener("scroll",this.onScroll)}};i(2);var r=function(t,e,i,o,s,n,r,l){var f,a="function"==typeof t?t.options:t;if(e&&(a.render=e,a.staticRenderFns=i,a._compiled=!0),o&&(a.functional=!0),n&&(a._scopeId="data-v-"+n),r?(f=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},a._ssrRegister=f):s&&(f=l?function(){s.call(this,this.$root.$options.shadowRoot)}:s),f)if(a.functional){a._injectStyles=f;var c=a.render;a.render=function(t,e){return f.call(e),c(t,e)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,f):[f]}return{exports:t,options:a}}(n,o,[],!1,null,null,null);r.options.__file="src/affix.vue";var l=r.exports;i.d(e,"Affix",function(){return l});var f={install:function(t){f.install.installed||t.component("affix",l)}};"undefined"!=typeof window&&window.Vue&&f.install(window.Vue);e.default=f},function(t,e,i){"use strict";function o(t,e){for(var i=[],o={},s=0;si.parts.length&&(o.parts.length=i.parts.length)}else{var r=[];for(s=0;s= this.affixBottomPos;\n },\n screenIsBeforeAffix: function screenIsBeforeAffix() {\n return this.topOfScreen <= this.affixTopPos;\n },\n screenIsBeforeRelativeElm: function screenIsBeforeRelativeElm() {\n return this.topOfScreen <= this.relativeElmTopPos - this.offset.top;\n },\n screenIsPastRelativeElm: function screenIsPastRelativeElm() {\n return this.bottomOfScreen >= this.relativeElmBottomPos + this.offset.bottom;\n },\n screenIsInsideRelativeElm: function screenIsInsideRelativeElm() {\n return !this.screenIsBeforeRelativeElm && !this.screenIsPastRelativeElm;\n }\n },\n data: function data() {\n return {\n affixHeight: null,\n affixRect: null,\n affixInitialTop: null,\n relativeElmOffsetTop: null,\n topPadding: null,\n lastState: null,\n currentState: null,\n currentScrollAffix: null,\n topOfScreen: window.pageYOffset,\n lastDistanceFromTop: window.pageYOffset,\n scrollingUp: null,\n scrollingDown: null\n };\n },\n methods: {\n updateData: function updateData() {\n this.topOfScreen = window.pageYOffset;\n this.affixRect = this.$el.getBoundingClientRect();\n this.affixHeight = this.$el.offsetHeight;\n this.relativeElmOffsetTop = this.getOffsetTop(this.relativeElement);\n },\n onScroll: function onScroll() {\n if (!this.enabled) {\n this.removeClasses();\n return;\n }\n\n this.updateData();\n var affixIsBiggerThanRelativeElement = this.affixHeight + this.offset.top >= this.relativeElement.offsetHeight;\n\n if (affixIsBiggerThanRelativeElement) {\n return;\n }\n\n var affixTotalHeight = this.affixHeight + this.offset.bottom + this.offset.top;\n var shouldUseScrollAffix = this.scrollAffix && affixTotalHeight > window.innerHeight;\n\n if (shouldUseScrollAffix) {\n this.handleScrollAffix();\n return;\n }\n\n this.handleAffix();\n },\n handleAffix: function handleAffix() {\n if (this.topOfScreen < this.relativeElmOffsetTop - this.offset.top) {\n this.setAffixTop();\n }\n\n if (this.topOfScreen >= this.relativeElmOffsetTop - this.offset.top && this.relativeElmBottomPos - this.offset.bottom >= this.topOfScreen + this.topPadding + this.affixHeight + this.offset.top) {\n this.setAffix();\n }\n\n if (this.relativeElmBottomPos - this.offset.bottom < this.topOfScreen + this.topPadding + this.affixHeight + this.offset.top) {\n this.setAffixBottom();\n }\n\n this.lastState = this.currentState;\n },\n handleScrollAffix: function handleScrollAffix() {\n this.setScrollingDirection();\n\n if (this.screenIsBeforeRelativeElm) {\n this.setScrollAffixTop();\n } else if (this.screenIsPastRelativeElm) {\n this.setScrollAffixBottom();\n } else if (this.screenIsInsideRelativeElm) {\n var shouldSetAffixScrolling = this.currentScrollAffix === 'scrollaffix-top' || this.currentScrollAffix === 'scrollaffix-bottom' || this.currentScrollAffix === 'scrollaffix-up' && this.scrollingDown || this.currentScrollAffix === 'scrollaffix-down' && this.scrollingUp;\n\n if (this.screenIsBeforeAffix && this.scrollingUp) {\n this.setScrollAffixUp();\n } else if (this.screenIsPastAffix && this.scrollingDown) {\n this.setScrollAffixDown();\n } else if (shouldSetAffixScrolling) {\n this.setScrollAffixScrolling();\n }\n }\n\n this.lastScrollAffixState = this.currentScrollAffix;\n this.lastDistanceFromTop = this.topOfScreen;\n },\n\n /**\n * Sets the initial position of the affixed element\n * when scrollAffix is set to true.\n */\n initScrollAffix: function initScrollAffix() {\n if (this.bottomOfScreen < this.affixBottomPos) {\n this.setScrollAffixTop();\n } else if (this.screenIsInsideRelativeElm) {\n this.setScrollAffixDown();\n } else if (this.screenIsPastRelativeElm) {\n this.setScrollAffixBottom();\n } else {\n this.setScrollAffixScrolling();\n }\n },\n\n /**\n * Sets te currentScrollAffix to 'scrolling' to indicate that\n * the window is scrolling inside the affixed element.\n */\n setScrollAffixScrolling: function setScrollAffixScrolling() {\n this.currentScrollAffix = 'scrollaffix-scrolling';\n this.$el.style.top = \"\".concat(Math.floor(this.affixRect.top) + this.topOfScreen - this.affixInitialTop, \"px\");\n this.$el.style.bottom = 'auto';\n this.removeClasses();\n this.emitEvent();\n },\n\n /**\n * Sets the position of the affixed element to be fixed\n * at the top of the screen, as you are scrolling UP.\n */\n setScrollAffixUp: function setScrollAffixUp() {\n this.currentScrollAffix = 'scrollaffix-up';\n\n if (this.currentScrollAffix !== this.lastScrollAffixState) {\n this.$el.style.top = \"\".concat(this.topPadding + this.offset.top, \"px\");\n this.$el.style.bottom = 'auto';\n this.removeClasses();\n this.emitEvent();\n this.$el.classList.add('affix');\n }\n },\n\n /**\n * Sets the position of the affixed element to be fixed\n * at the bottom of the screen, as you are scrolling DOWN.\n */\n setScrollAffixDown: function setScrollAffixDown() {\n this.currentScrollAffix = 'scrollaffix-down';\n\n if (this.currentScrollAffix !== this.lastScrollAffixState) {\n this.$el.style.bottom = \"\".concat(this.offset.bottom, \"px\");\n this.$el.style.top = 'auto';\n this.removeClasses();\n this.emitEvent();\n this.$el.classList.add('affix');\n }\n },\n\n /**\n * Sets the position of the affixed element to be at the\n * most top.\n */\n setScrollAffixTop: function setScrollAffixTop() {\n this.currentScrollAffix = 'scrollaffix-top';\n this.$el.style.top = 0;\n this.$el.style.bottom = 'auto';\n this.removeClasses();\n this.emitEvent();\n },\n\n /**\n * Sets the position of the affixed element to be at the\n * most bottom.\n */\n setScrollAffixBottom: function setScrollAffixBottom() {\n this.currentScrollAffix = 'scrollaffix-bottom';\n this.$el.style.top = \"\".concat(this.relativeElmBottomPos - this.affixInitialTop - this.affixHeight, \"px\");\n this.$el.style.bottom = 'auto';\n this.removeClasses();\n this.emitEvent();\n },\n\n /**\n * Sets the direction the window is being scrolled.\n */\n setScrollingDirection: function setScrollingDirection() {\n if (this.topOfScreen > this.lastDistanceFromTop) {\n this.scrollingDown = true;\n this.scrollingUp = false;\n } else {\n this.scrollingUp = true;\n this.scrollingDown = false;\n }\n },\n\n /**\n * Sets the affix-top class to indicate that the element is\n * above the relative element.\n */\n setAffixTop: function setAffixTop() {\n this.currentState = 'affix-top';\n\n if (this.currentState !== this.lastState) {\n this.emitEvent();\n this.removeClasses();\n this.$el.classList.remove('affix');\n this.$el.classList.add('affix-top');\n this.$el.style.top = null;\n }\n },\n\n /**\n * Sets the affix class to indicate that the element is\n * fixed to the top of the relative element.\n */\n setAffix: function setAffix() {\n this.currentState = 'affix';\n this.$el.style.top = \"\".concat(this.topPadding + this.offset.top, \"px\");\n\n if (this.currentState !== this.lastState) {\n this.emitEvent();\n this.removeClasses();\n this.$el.classList.add('affix');\n }\n },\n\n /**\n * Sets the affix-bottom class to indicate that the element is\n * below the relative element.\n */\n setAffixBottom: function setAffixBottom() {\n this.currentState = 'affix-bottom';\n this.$el.style.top = \"\".concat(this.relativeElement.offsetHeight - this.affixHeight - this.offset.bottom - this.topPadding, \"px\");\n\n if (this.currentState !== this.lastState) {\n this.emitEvent();\n this.removeClasses();\n this.$el.classList.add('affix-bottom');\n }\n },\n\n /**\n * Removes all three affix classes.\n */\n removeClasses: function removeClasses() {\n this.$el.classList.remove('affix-top');\n this.$el.classList.remove('affix');\n this.$el.classList.remove('affix-bottom');\n },\n\n /**\n * Emits the events based on the current state of the affix.\n */\n emitEvent: function emitEvent() {\n if (this.scrollAffix && this.lastScrollAffixState && this.currentScrollAffix !== this.lastScrollAffixState) {\n this.$emit(this.currentScrollAffix.replace('-', ''));\n }\n\n if (this.lastState) {\n this.$emit(this.currentState.replace('-', ''));\n }\n },\n\n /**\n * Gets the top offset position of an element in the document.\n *\n * @param {Element} element\n * @return {Number}\n */\n getOffsetTop: function getOffsetTop(element) {\n var yPosition = 0;\n var nextElement = element;\n\n while (nextElement) {\n yPosition += nextElement.offsetTop;\n nextElement = nextElement.offsetParent;\n }\n\n return yPosition;\n }\n },\n mounted: function mounted() {\n this.$el.classList.add('vue-affix');\n this.affixInitialTop = this.getOffsetTop(this.$el);\n this.topPadding = this.affixInitialTop - this.getOffsetTop(this.relativeElement);\n this.updateData();\n if (this.scrollAffix) this.initScrollAffix();\n this.onScroll();\n window.addEventListener('scroll', this.onScroll);\n },\n beforeDestroy: function beforeDestroy() {\n window.removeEventListener('scroll', this.onScroll);\n }\n});\n\n//# sourceURL=webpack://vueAffix/./src/affix.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); + +/***/ }), + +/***/ "./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib/index.js?!./src/affix.vue?vue&type=style&index=0&lang=css&": +/*!*********************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options!./src/affix.vue?vue&type=style&index=0&lang=css& ***! + \*********************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/lib/css-base.js */ \"./node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \"\\n.vue-affix {\\n position: relative;\\n}\\n.affix {\\n position: fixed;\\n}\\n.affix-bottom {\\n position: relative;\\n}\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack://vueAffix/./src/affix.vue?./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options"); + +/***/ }), + +/***/ "./node_modules/css-loader/lib/css-base.js": +/*!*************************************************!*\ + !*** ./node_modules/css-loader/lib/css-base.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n//# sourceURL=webpack://vueAffix/./node_modules/css-loader/lib/css-base.js?"); + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./src/affix.vue?vue&type=template&id=8e50b472&": +/*!************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/affix.vue?vue&type=template&id=8e50b472& ***! + \************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [_vm._t(\"default\")], 2)\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://vueAffix/./src/affix.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js": +/*!********************************************************************!*\ + !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return normalizeComponent; });\n/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nfunction normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n\n\n//# sourceURL=webpack://vueAffix/./node_modules/vue-loader/lib/runtime/componentNormalizer.js?"); + +/***/ }), + +/***/ "./node_modules/vue-style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib/index.js?!./src/affix.vue?vue&type=style&index=0&lang=css&": +/*!*****************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options!./src/affix.vue?vue&type=style&index=0&lang=css& ***! + \*****************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("// style-loader: Adds some css to the DOM by adding a