biofriction-wp-theme/node_modules/foundation-sites/dist/js/plugins/foundation.smoothScroll.min.js

3 lines
5.1 KiB
JavaScript

!function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("./foundation.core"),require("./foundation.core.plugin"),require("./foundation.core.utils"),require("jquery")):"function"==typeof define&&define.amd?define(["./foundation.core","./foundation.core.plugin","./foundation.core.utils","jquery"],o):"object"==typeof exports?exports["foundation.smoothScroll"]=o(require("./foundation.core"),require("./foundation.core.plugin"),require("./foundation.core.utils"),require("jquery")):(t.__FOUNDATION_EXTERNAL__=t.__FOUNDATION_EXTERNAL__||{},t.__FOUNDATION_EXTERNAL__["foundation.smoothScroll"]=o(t.__FOUNDATION_EXTERNAL__["foundation.core"],t.__FOUNDATION_EXTERNAL__["foundation.core"],t.__FOUNDATION_EXTERNAL__["foundation.core"],t.jQuery))}(window,function(e,n,r,i){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(t,o,e){r.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(o,t){if(1&t&&(o=r(o)),8&t)return o;if(4&t&&"object"==typeof o&&o&&o.__esModule)return o;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:o}),2&t&&"string"!=typeof o)for(var n in o)r.d(e,n,function(t){return o[t]}.bind(null,n));return e},r.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(o,"a",o),o},r.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},r.p="",r(r.s=16)}({"./foundation.core":function(t,o){t.exports=e},"./foundation.core.plugin":function(t,o){t.exports=n},"./foundation.core.utils":function(t,o){t.exports=r},"./js/entries/plugins/foundation.smoothScroll.js":function(t,o,e){"use strict";e.r(o);var n=e("./foundation.core");e.d(o,"Foundation",function(){return n.Foundation});var r=e("./js/foundation.smoothScroll.js");e.d(o,"SmoothScroll",function(){return r.SmoothScroll}),n.Foundation.plugin(r.SmoothScroll,"SmoothScroll")},"./js/foundation.smoothScroll.js":function(t,o,e){"use strict";e.r(o),e.d(o,"SmoothScroll",function(){return d});var n=e("jquery"),u=e.n(n),r=e("./foundation.core.utils"),l=e("./foundation.core.plugin");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,o){for(var e=0;e<o.length;e++){var n=o[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function f(t,o){return!o||"object"!==i(o)&&"function"!=typeof o?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t):o}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,o){return(s=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}var d=function(t){function i(){return function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,i),f(this,a(i).apply(this,arguments))}var o,e,n;return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&s(t,o)}(i,l["Plugin"]),o=i,n=[{key:"scrollToLoc",value:function(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:i.defaults,e=2<arguments.length?arguments[2]:void 0,n=u()(t);if(!n.length)return!1;var r=Math.round(n.offset().top-o.threshold/2-o.offset);u()("html, body").stop(!0).animate({scrollTop:r},o.animationDuration,o.animationEasing,function(){"function"==typeof e&&e()})}}],(e=[{key:"_setup",value:function(t,o){this.$element=t,this.options=u.a.extend({},i.defaults,this.$element.data(),o),this.className="SmoothScroll",this._init()}},{key:"_init",value:function(){var t=this.$element[0].id||Object(r.GetYoDigits)(6,"smooth-scroll");this.$element.attr({id:t}),this._events()}},{key:"_events",value:function(){this.$element.on("click.zf.smoothScroll",this._handleLinkClick),this.$element.on("click.zf.smoothScroll",'a[href^="#"]',this._handleLinkClick)}},{key:"_handleLinkClick",value:function(t){var o=this;if(u()(t.currentTarget).is('a[href^="#"]')){var e=t.currentTarget.getAttribute("href");this._inTransition=!0,i.scrollToLoc(e,this.options,function(){o._inTransition=!1}),t.preventDefault()}}},{key:"_destroy",value:function(){this.$element.off("click.zf.smoothScroll",this._handleLinkClick),this.$element.off("click.zf.smoothScroll",'a[href^="#"]',this._handleLinkClick)}}])&&c(o.prototype,e),n&&c(o,n),i}();d.defaults={animationDuration:500,animationEasing:"linear",threshold:50,offset:0}},16:function(t,o,e){t.exports=e("./js/entries/plugins/foundation.smoothScroll.js")},jquery:function(t,o){t.exports=i}})});
//# sourceMappingURL=foundation.smoothScroll.min.js.map