*/
var foundation = function(method) {
var type = typeof method,
- $meta = $('meta.foundation-mq'),
$noJS = $('.no-js');
- if(!$meta.length){
- $('<meta class="foundation-mq">').appendTo(document.head);
- }
if($noJS.length){
$noJS.removeClass('no-js');
}
var eqId = this.$element.attr('data-equalizer') || '';
var $watched = this.$element.find(`[data-equalizer-watch="${eqId}"]`);
+ MediaQuery._init();
+
this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
this.$element.attr('data-resize', (eqId || GetYoDigits(6, 'eq')));
- this.$element.attr('data-mutate', (eqId || GetYoDigits(6, 'eq')));
+ this.$element.attr('data-mutate', (eqId || GetYoDigits(6, 'eq')));
this.hasNested = this.$element.find('[data-equalizer]').length > 0;
this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;
* @private
*/
_init() {
+ MediaQuery._init();
+
var id = this.$element[0].id || Foundation.GetYoDigits(6, 'interchange');
this.$element.attr({
'data-resize': id,
//Triggers init is idempotent, just need to make sure it is initialized
Triggers.init($);
+ MediaQuery._init();
this._init();
this._events();
* @private
*/
_init() {
+ MediaQuery._init();
+
// The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
if (typeof this.rules === 'string') {
let rulesTree = {};
* @private
*/
_init() {
+
+ MediaQuery._init();
// The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
if (typeof this.rules === 'string') {
let rulesTree = {};
* @private
*/
_init() {
+ MediaQuery._init();
var targetID = this.$element.data('responsive-toggle');
if (!targetID) {
console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');
* @private
*/
_init() {
+ MediaQuery._init();
this.id = this.$element.attr('id');
this.isActive = false;
this.cached = {mq: MediaQuery.current};
* @private
*/
_init() {
+ MediaQuery._init();
+
var $parent = this.$element.parent('[data-sticky-container]'),
id = this.$element[0].id || GetYoDigits(6, 'sticky'),
_this = this;
* @private
*/
_init() {
+ MediaQuery._init();
var elemId = this.$element.attr('aria-describedby') || GetYoDigits(6, 'tooltip');
this.options.tipText = this.options.tipText || this.$element.attr('title');
*/
_init() {
var self = this;
+ var $meta = $('meta.foundation-mq');
+ if(!$meta.length){
+ $('<meta class="foundation-mq">').appendTo(document.head);
+ }
+
var extractedStyles = $('.foundation-mq').css('font-family');
var namedQueries;
* @private
*/
_watcher() {
- $(window).on('resize.zf.mediaquery', () => {
+ $(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', () => {
var newSize = this._getCurrentSize(), currentSize = this.current;
if (newSize !== currentSize) {