<script src="assets/js/plugins/foundation.dropdownMenu.js"></script>
<script src="assets/js/plugins/foundation.equalizer.js"></script>
<script src="assets/js/plugins/foundation.interchange.js"></script>
+ <script src="assets/js/plugins/foundation.smoothScroll.js"></script>
<script src="assets/js/plugins/foundation.magellan.js"></script>
<script src="assets/js/plugins/foundation.offcanvas.js"></script>
<script src="assets/js/plugins/foundation.orbit.js"></script>
'./foundation.accordionMenu' : '{AccordionMenu: window.Foundation.AccordionMenu}',
'./foundation.accordion' : '{Accordion: window.Foundation.Accordion}',
'./foundation.tabs' : '{Tabs: window.Foundation.Tabs}',
+ './foundation.smoothScroll' : '{SmoothScroll: window.Foundation.SmoothScroll}',
}
// Core has to be dealt with slightly differently due to bootstrapping externals
import { Slider } from '../foundation.slider';
Foundation.plugin(Slider, 'Slider');
+import { SmoothScroll } from '../foundation.smoothScroll';
+Foundation.plugin(SmoothScroll, 'SmoothScroll');
+
import { Sticky } from '../foundation.sticky';
Foundation.plugin(Sticky, 'Sticky');
--- /dev/null
+import { Foundation } from './foundation.core';
+
+import { SmoothScroll } from '../../foundation.smoothScroll';
+Foundation.plugin(SmoothScroll, 'SmoothScroll');
+
import $ from 'jquery';
import { GetYoDigits } from './foundation.util.core';
import { Plugin } from './foundation.plugin';
+import { SmoothScroll } from './foundation.smoothScroll';
/**
* Magellan module.
offset: this.options.offset
};
- Foundation.SmoothScroll.scrollToLoc(loc, options, function() {
+ SmoothScroll.scrollToLoc(loc, options, function() {
_this._inTransition = false;
_this._updateActive();
})
'use strict';
-!function($) {
+import $ from 'jquery';
+import { GetYoDigits } from './foundation.util.core';
+import { Plugin } from './foundation.plugin';
/**
* SmoothScroll module.
* @module foundation.smooth-scroll
*/
-class SmoothScroll {
- constructor(element, options) {
+class SmoothScroll extends Plugin {
+ _setup(element, options) {
this.$element = element;
this.options = $.extend({}, SmoothScroll.defaults, this.$element.data(), options);
this._init();
-
- Foundation.registerPlugin(this, 'SmoothScroll');
}
/**
* @private
*/
_init() {
- var id = this.$element[0].id || Foundation.GetYoDigits(6, 'smooth-scroll');
+ var id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll');
var _this = this;
this.$element.attr({
'id': id
}
);
}
-
- /**
- * Destroys an instance of SmoothScroll.
- * @function
- */
- destory() {
- Foundation.unregisterPlugin(this);
- }
}
/**
offset: 0
}
-// Window exports
-Foundation.plugin(SmoothScroll, 'SmoothScroll');
-}(jQuery);
+export {SmoothScroll}