diff --git a/dist/float-sidebar.js b/dist/float-sidebar.js index bdeb22e..aa00911 100644 --- a/dist/float-sidebar.js +++ b/dist/float-sidebar.js @@ -3,7 +3,7 @@ * @version v1.2.4 * @link https://github.com/vursen/FloatSidebar.js * @author Sergey Vinogradov - * @license The MIT License (MIT) + * @license MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -163,22 +163,22 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj /* harmony default export */ var fsm_transitions = (fsm_transitions_states$START$states$ = {}, fsm_transitions_defineProperty(fsm_transitions_states$START$states$, START, [{ to: FINISH, when: function when(d) { - return [d.isSideInnerFitsPath === true, d.viewportTop + d.sideInnerHeight > d.finishPoint]; + return [d.isSideInnerWithinPath === true, d.viewportTop + d.sideInnerHeight + d.bottomSpacing > d.finishPoint, d.viewportBottom > d.finishPoint]; } }, { to: BOTTOM_FIXED, when: function when(d) { - return [d.isSideInnerFitsPath === true, d.isSideInnerFitsViewport === false, d.viewportBottom > d.sideInnerBottom + d.bottomSpacing]; + return [d.isSideInnerWithinPath === true, d.isSideInnerWithinViewport === false, d.viewportBottom > d.sideInnerBottom + d.bottomSpacing]; } }, { to: TOP_FIXED, when: function when(d) { - return [d.isSideInnerFitsPath === true, d.isSideInnerFitsViewport === true, d.viewportTop > d.startPoint - d.topSpacing]; + return [d.isSideInnerWithinPath === true, d.isSideInnerWithinViewport === true, d.viewportTop > d.startPoint - d.topSpacing]; } }]), fsm_transitions_defineProperty(fsm_transitions_states$START$states$, TOP_FIXED, [{ to: START, when: function when(d) { - return [d.isSideInnerFitsPath === false]; + return [d.isSideInnerWithinPath === false]; } }, { to: START, @@ -193,12 +193,12 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj }, { to: UNFIXED, when: function when(d) { - return [d.scrollDirection === 'down', d.isSideInnerFitsViewport === false]; + return [d.scrollDirection === 'down', d.isSideInnerWithinViewport === false]; } }]), fsm_transitions_defineProperty(fsm_transitions_states$START$states$, UNFIXED, [{ to: START, when: function when(d) { - return [d.isSideInnerFitsPath === false]; + return [d.isSideInnerWithinPath === false]; } }, { to: START, @@ -208,7 +208,7 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj }, { to: FINISH, when: function when(d) { - return [d.viewportTop + d.sideInnerHeight > d.finishPoint]; + return [d.viewportBottom > d.finishPoint]; } }, { to: TOP_FIXED, @@ -218,22 +218,22 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj }, { to: TOP_FIXED, when: function when(d) { - return [d.isSideInnerFitsViewport === true, d.viewportBottom >= d.sideInnerBottom + d.bottomSpacing]; + return [d.isSideInnerWithinViewport === true, d.viewportBottom >= d.sideInnerBottom + d.bottomSpacing]; } }, { to: BOTTOM_FIXED, when: function when(d) { - return [d.isSideInnerFitsViewport === false, d.viewportBottom > d.sideInnerBottom + d.bottomSpacing]; + return [d.isSideInnerWithinViewport === false, d.viewportBottom > d.sideInnerBottom + d.bottomSpacing]; } }]), fsm_transitions_defineProperty(fsm_transitions_states$START$states$, BOTTOM_FIXED, [{ to: START, when: function when(d) { - return [d.isSideInnerFitsPath === false]; + return [d.isSideInnerWithinPath === false]; } }, { to: START, when: function when(d) { - return [d.isSideInnerFitsPath === true, d.sideInnerTop <= d.startPoint - d.topSpacing]; + return [d.isSideInnerWithinPath === true, d.sideInnerTop <= d.startPoint - d.topSpacing]; } }, { to: UNFIXED, @@ -243,7 +243,7 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj }, { to: TOP_FIXED, when: function when(d) { - return [d.isSideInnerFitsViewport === true]; + return [d.isSideInnerWithinViewport === true]; } }, { to: FINISH, @@ -253,7 +253,7 @@ function fsm_transitions_defineProperty(obj, key, value) { if (key in obj) { Obj }]), fsm_transitions_defineProperty(fsm_transitions_states$START$states$, FINISH, [{ to: START, when: function when(d) { - return [d.isSideInnerFitsPath === false]; + return [d.isSideInnerWithinPath === false]; } }, { to: START, @@ -367,8 +367,8 @@ function createDimensionObserver(callback, _ref) { var pathHeight = finishPoint - startPoint; - var isSideInnerFitsViewport = dim$sideInner.height + topSpacing + bottomSpacing < dim$viewport.height; - var isSideInnerFitsPath = dim$sideInner.height < pathHeight; + var isSideInnerWithinViewport = dim$sideInner.height + topSpacing + bottomSpacing < dim$viewport.height; + var isSideInnerWithinPath = dim$sideInner.height < pathHeight; var sideOuterHeight = Math.max(dim$sideInner.height, pathHeight); @@ -378,8 +378,8 @@ function createDimensionObserver(callback, _ref) { topSpacing: topSpacing, bottomSpacing: bottomSpacing, scrollDirection: scrollDirection, - isSideInnerFitsPath: isSideInnerFitsPath, - isSideInnerFitsViewport: isSideInnerFitsViewport, + isSideInnerWithinPath: isSideInnerWithinPath, + isSideInnerWithinViewport: isSideInnerWithinViewport, sideOuterHeight: sideOuterHeight, diff --git a/dist/float-sidebar.min.js b/dist/float-sidebar.min.js index 8935a11..fcecbcd 100644 --- a/dist/float-sidebar.min.js +++ b/dist/float-sidebar.min.js @@ -3,6 +3,6 @@ * @version v1.2.4 * @link https://github.com/vursen/FloatSidebar.js * @author Sergey Vinogradov - * @license The MIT License (MIT) + * @license MIT */ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.FloatSidebar=n():t.FloatSidebar=n()}(window,(function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(o,i,function(n){return t[n]}.bind(null,i));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";e.r(n);var o,i="START";function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var s,u=(r(o={},i,(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top="0",e.style.bottom="auto"})),r(o,"TOP_FIXED",(function(t,n){var e=n.$sideInner;e.style.position="fixed",e.style.top=t.topSpacing+"px",e.style.bottom="auto"})),r(o,"UNFIXED",(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top=t.sideInnerTop-t.startPoint+"px",e.style.bottom="auto"})),r(o,"BOTTOM_FIXED",(function(t,n){var e=n.$sideInner;e.style.position="fixed",e.style.top="auto",e.style.bottom=t.bottomSpacing+"px"})),r(o,"FINISH",(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top="auto",e.style.bottom="0"})),o);function a(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var p=(a(s={},i,[{to:"FINISH",when:function(t){return[!0===t.isSideInnerFitsPath,t.viewportTop+t.sideInnerHeight>t.finishPoint]}},{to:"BOTTOM_FIXED",when:function(t){return[!0===t.isSideInnerFitsPath,!1===t.isSideInnerFitsViewport,t.viewportBottom>t.sideInnerBottom+t.bottomSpacing]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerFitsPath,!0===t.isSideInnerFitsViewport,t.viewportTop>t.startPoint-t.topSpacing]}}]),a(s,"TOP_FIXED",[{to:i,when:function(t){return[!1===t.isSideInnerFitsPath]}},{to:i,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"FINISH",when:function(t){return[t.sideInnerBottom>t.finishPoint]}},{to:"UNFIXED",when:function(t){return["down"===t.scrollDirection,!1===t.isSideInnerFitsViewport]}}]),a(s,"UNFIXED",[{to:i,when:function(t){return[!1===t.isSideInnerFitsPath]}},{to:i,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"FINISH",when:function(t){return[t.viewportTop+t.sideInnerHeight>t.finishPoint]}},{to:"TOP_FIXED",when:function(t){return["up"===t.scrollDirection,t.viewportTop<=t.sideInnerTop-t.topSpacing]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerFitsViewport,t.viewportBottom>=t.sideInnerBottom+t.bottomSpacing]}},{to:"BOTTOM_FIXED",when:function(t){return[!1===t.isSideInnerFitsViewport,t.viewportBottom>t.sideInnerBottom+t.bottomSpacing]}}]),a(s,"BOTTOM_FIXED",[{to:i,when:function(t){return[!1===t.isSideInnerFitsPath]}},{to:i,when:function(t){return[!0===t.isSideInnerFitsPath,t.sideInnerTop<=t.startPoint-t.topSpacing]}},{to:"UNFIXED",when:function(t){return["up"===t.scrollDirection]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerFitsViewport]}},{to:"FINISH",when:function(t){return[t.sideInnerBottom>t.finishPoint]}}]),a(s,"FINISH",[{to:i,when:function(t){return[!1===t.isSideInnerFitsPath]}},{to:i,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"BOTTOM_FIXED",when:function(t){return[t.sideInnerBottom+t.bottomSpacing<=t.finishPoint,t.viewportBottomt?"up":"notChanged"),h=c.top,I=d.bottom,v=I-h,w=p.height+s+u=1&&(e.style.height=n.sideOuterHeight+"px")};return requestAnimationFrame((function(){e.style.willChange="height",o.style.width="inherit",o.style.transform="translateZ(0)",o.style.willChange="transform",h.start()})),{forceUpdate:function(){h.tick()},destroy:function(){h.stop()}}}}]).default})); \ No newline at end of file +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.FloatSidebar=n():t.FloatSidebar=n()}(window,(function(){return function(t){var n={};function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(i,o,function(n){return t[n]}.bind(null,o));return i},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";e.r(n);var i,o="START";function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var u,a=(r(i={},o,(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top="0",e.style.bottom="auto"})),r(i,"TOP_FIXED",(function(t,n){var e=n.$sideInner;e.style.position="fixed",e.style.top=t.topSpacing+"px",e.style.bottom="auto"})),r(i,"UNFIXED",(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top=t.sideInnerTop-t.startPoint+"px",e.style.bottom="auto"})),r(i,"BOTTOM_FIXED",(function(t,n){var e=n.$sideInner;e.style.position="fixed",e.style.top="auto",e.style.bottom=t.bottomSpacing+"px"})),r(i,"FINISH",(function(t,n){var e=n.$sideInner;e.style.position="absolute",e.style.top="auto",e.style.bottom="0"})),i);function s(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var p=(s(u={},o,[{to:"FINISH",when:function(t){return[!0===t.isSideInnerWithinPath,t.viewportTop+t.sideInnerHeight+t.bottomSpacing>t.finishPoint,t.viewportBottom>t.finishPoint]}},{to:"BOTTOM_FIXED",when:function(t){return[!0===t.isSideInnerWithinPath,!1===t.isSideInnerWithinViewport,t.viewportBottom>t.sideInnerBottom+t.bottomSpacing]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerWithinPath,!0===t.isSideInnerWithinViewport,t.viewportTop>t.startPoint-t.topSpacing]}}]),s(u,"TOP_FIXED",[{to:o,when:function(t){return[!1===t.isSideInnerWithinPath]}},{to:o,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"FINISH",when:function(t){return[t.sideInnerBottom>t.finishPoint]}},{to:"UNFIXED",when:function(t){return["down"===t.scrollDirection,!1===t.isSideInnerWithinViewport]}}]),s(u,"UNFIXED",[{to:o,when:function(t){return[!1===t.isSideInnerWithinPath]}},{to:o,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"FINISH",when:function(t){return[t.viewportBottom>t.finishPoint]}},{to:"TOP_FIXED",when:function(t){return["up"===t.scrollDirection,t.viewportTop<=t.sideInnerTop-t.topSpacing]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerWithinViewport,t.viewportBottom>=t.sideInnerBottom+t.bottomSpacing]}},{to:"BOTTOM_FIXED",when:function(t){return[!1===t.isSideInnerWithinViewport,t.viewportBottom>t.sideInnerBottom+t.bottomSpacing]}}]),s(u,"BOTTOM_FIXED",[{to:o,when:function(t){return[!1===t.isSideInnerWithinPath]}},{to:o,when:function(t){return[!0===t.isSideInnerWithinPath,t.sideInnerTop<=t.startPoint-t.topSpacing]}},{to:"UNFIXED",when:function(t){return["up"===t.scrollDirection]}},{to:"TOP_FIXED",when:function(t){return[!0===t.isSideInnerWithinViewport]}},{to:"FINISH",when:function(t){return[t.sideInnerBottom>t.finishPoint]}}]),s(u,"FINISH",[{to:o,when:function(t){return[!1===t.isSideInnerWithinPath]}},{to:o,when:function(t){return[t.viewportTop<=t.startPoint-t.topSpacing]}},{to:"BOTTOM_FIXED",when:function(t){return[t.sideInnerBottom+t.bottomSpacing<=t.finishPoint,t.viewportBottomt?"up":"notChanged"),l=c.top,I=d.bottom,v=I-l,w=p.height+u+a=1&&(e.style.height=n.sideOuterHeight+"px")};return requestAnimationFrame((function(){e.style.willChange="height",i.style.width="inherit",i.style.transform="translateZ(0)",i.style.willChange="transform",l.start()})),{forceUpdate:function(){l.tick()},destroy:function(){l.stop()}}}}]).default})); \ No newline at end of file diff --git a/package.json b/package.json index 1214993..aca01ae 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/vursen/FloatSidebar.js/issues" }, "homepage": "https://github.com/vursen/FloatSidebar.js", - "version": "1.2.4", + "version": "1.2.5", "main": "./dist/float-sidebar.min.js", "module": "./dist/float-sidebar.js", "devDependencies": {