Touch.init($);
import { Triggers } from '../foundation.util.triggers';
-Triggers.init(Foundation, $);
+Triggers.init($, Foundation);
import { Abide } from '../foundation.abide';
Foundation.plugin(Abide, 'Abide');
import $ from 'jquery';
import { Triggers } from '../../foundation.util.triggers';
-Triggers.init(Foundation, $);
+Triggers.init($, Foundation);
import { GetYoDigits } from './foundation.util.core';
import { Plugin } from './foundation.plugin';
- // import "foundation.util.triggers.js";
- // TODO: Figure out what a triggers import "means", since triggers are always accessed indirectly.
+import { Triggers } from './foundation.util.triggers';
/**
_setup(element, options) {
this.$element = element;
this.options = $.extend({}, Dropdown.defaults, this.$element.data(), options);
+
+ // Triggers init is idempotent, just need to make sure it is initialized
+ Triggers.init($);
+
this._init();
Keyboard.register('Dropdown', {
import { transitionend } from './foundation.util.core';
import { Plugin } from './foundation.plugin';
- // import "foundation.util.triggers.js";
- // TODO: Figure out what triggers import should actually do, given how indirect their use is
+import { Triggers } from './foundation.util.triggers';
/**
* OffCanvas module.
this.$lastTrigger = $();
this.$triggers = $();
+ //Triggers init is idempotent, just need to make sure it is initialized
+ Triggers.init($);
+
this._init();
this._events();
import { Plugin } from './foundation.plugin';
import { Touch } from './foundation.util.touch';
+
+import { Triggers } from './foundation.util.triggers';
/**
* Slider module.
* @module foundation.slider
this.$element = element;
this.options = $.extend({}, Slider.defaults, this.$element.data(), options);
- Touch.init($); // Touch init is idempotent, we just need to make sure it's initialied.
+ // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
+ Touch.init($);
+ Triggers.init($);
+
this._init();
Keyboard.register('Slider', {
if(!$(this).is('a[href^="#"]')) {
return false;
}
-
+
var arrival = this.getAttribute('href');
-
+
_this._inTransition = true;
SmoothScroll.scrollToLoc(arrival, _this.options, function() {
_this._inTransition = false;
});
-
+
e.preventDefault();
};
import { GetYoDigits } from './foundation.util.core';
import { MediaQuery } from './foundation.util.mediaQuery';
import { Plugin } from './foundation.plugin';
+import { Triggers } from './foundation.util.triggers';
+
/**
* Sticky module.
* @module foundation.sticky
this.$element = element;
this.options = $.extend({}, Sticky.defaults, this.$element.data(), options);
+ // Triggers init is idempotent, just need to make sure it is initialized
+ Triggers.init($);
+
this._init();
}
import $ from 'jquery';
import { Motion } from './foundation.util.motion';
import { Plugin } from './foundation.plugin';
-
- // import "foundation.util.triggersjs";
+import { Triggers } from './foundation.util.triggers';
/**
* Toggler module.
this.options = $.extend({}, Toggler.defaults, element.data(), options);
this.className = '';
+ // Triggers init is idempotent, just need to make sure it is initialized
+ Triggers.init($);
+
this._init();
this._events();
}
import { Box } from './foundation.util.box';
import { GetYoDigits } from './foundation.util.core';
import { MediaQuery } from './foundation.util.mediaQuery';
+import { Triggers } from './foundation.util.triggers';
import { Plugin } from './foundation.plugin';
- // import "foundation.util.triggers";
-
/**
* Tooltip module.
* @module foundation.tooltip
this.isActive = false;
this.isClick = false;
+
+ // Triggers init is idempotent, just need to make sure it is initialized
+ Triggers.init($);
+
this._init();
}
}
-Triggers.init = function(Foundation, $) {
+Triggers.init = function($, Foundation) {
if (typeof($.triggersInitialized) === 'undefined') {
let $document = $(document);
Triggers.Initializers.addGlobalListeners();
});
}
- Foundation.Triggers = Triggers;
+
+ $.triggersInitialized = true;
+ }
+
+ if(Foundation) {
+ Foundation.Triggers = Triggers;
// Legacy included to be backwards compatible for now.
Foundation.IHearYou = Triggers.Initializers.addGlobalListeners
- $.triggersInitialized = true;
}
}