From: zurbchris Date: Wed, 18 Nov 2015 03:26:41 +0000 (-0800) Subject: adds or updates docs comments, Foundation.register/unregisterPlugin integration,... X-Git-Tag: v6.0.0^2~24^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40998e6623f5f3a86aa48a17bc62b9c2f641e84c;p=thirdparty%2Ffoundation%2Ffoundation-sites.git adds or updates docs comments, Foundation.register/unregisterPlugin integration, and typo fixes --- diff --git a/js/foundation.abide.js b/js/foundation.abide.js index bab5820ed..de0ff76a3 100644 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@ -18,11 +18,7 @@ this._init(); this._events(); - /** - * Fires when the plugin has been successfuly initialized. - * @event Abide#init - */ - this.$element.trigger('init.zf.abide'); + Foundation.registerPlugin(this); } /** @@ -379,6 +375,9 @@ $form.find('[data-abide-error]').css('display', 'none'); $(':input', $form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr(invalidAttr); }; + Abide.prototype.destroy = function(){ + //TODO this... + }; Foundation.plugin(Abide); diff --git a/js/foundation.accordion.js b/js/foundation.accordion.js index fe25b713a..3db5999d7 100644 --- a/js/foundation.accordion.js +++ b/js/foundation.accordion.js @@ -18,10 +18,7 @@ this.options = $.extend({}, Accordion.defaults, this.$element.data(), options); this._init(); - /** - * Fires when the plugin has been successfuly initialized. - * @event Accordion#init - */ + Foundation.registerPlugin(this); Foundation.Keyboard.register('Accordion', { 'ENTER': 'toggle', @@ -222,11 +219,6 @@ this.$element.find('[data-tab-content]').slideUp(0).css('display', ''); this.$element.find('a').off('.zf.accordion'); - /** - * Fires when the plugin has been destroyed. - * @event Accordion#destroyed - */ - // this.$element.trigger('destroyed.zf.accordion'); Foundation.unregisterPlugin(this); }; diff --git a/js/foundation.accordionMenu.js b/js/foundation.accordionMenu.js index 6cd684dfd..c6da2b426 100644 --- a/js/foundation.accordionMenu.js +++ b/js/foundation.accordionMenu.js @@ -23,12 +23,6 @@ this._init(); - - /** - * Fires when the plugin has been successfuly initialized. - * @event AccordionMenu#init - */ - // this.$element.trigger('init.zf.accordionMenu'); Foundation.registerPlugin(this); Foundation.Keyboard.register('AccordionMenu', { 'ENTER': 'toggle', @@ -257,11 +251,6 @@ this.$element.find('[data-submenu]').slideDown(0).css('display', ''); this.$element.find('a').off('click.zf.accordionMenu'); - /** - * Fires when the plugin has been destroyed. - * @event AccordionMenu#destroy - */ - // this.$element.trigger('destroyed.zf.accordionMenu'); Foundation.Nest.Burn(this.$element, 'accordion'); Foundation.unregisterPlugin(this); }; diff --git a/js/foundation.equalizer.js b/js/foundation.equalizer.js index 8294b83e3..58a24c3ee 100644 --- a/js/foundation.equalizer.js +++ b/js/foundation.equalizer.js @@ -19,11 +19,6 @@ this._events(); Foundation.registerPlugin(this); - // /** - // * Fires when the plugin has been successfuly initialized. - // * @event Equalizer#init - // */ - // this.$element.trigger('init.zf.equalizer'); } /** diff --git a/js/foundation.interchange.js b/js/foundation.interchange.js index cffcfa6e2..c971e31d6 100644 --- a/js/foundation.interchange.js +++ b/js/foundation.interchange.js @@ -170,7 +170,7 @@ */ Interchange.prototype.destroy = function(){ //TODO this. - } + }; Foundation.plugin(Interchange); // Exports for AMD/Browserify diff --git a/js/foundation.responsiveMenu.js b/js/foundation.responsiveMenu.js index 96b3dc771..7c00684f8 100644 --- a/js/foundation.responsiveMenu.js +++ b/js/foundation.responsiveMenu.js @@ -49,11 +49,6 @@ this._events(); Foundation.registerPlugin(this); - // /** - // * Fires when the plugin has been successfuly initialized. - // * @event ResponsiveMenu#init - // */ - // this.$element.trigger('init.zf.ResponsiveMenu'); } ResponsiveMenu.defaults = {}; @@ -143,6 +138,7 @@ ResponsiveMenu.prototype.destroy = function() { this.currentPlugin.destroy(); $(window).off('.zf.ResponsiveMenu'); + Foundation.unregisterPlugin(this); }; Foundation.plugin(ResponsiveMenu); diff --git a/js/foundation.responsiveToggle.js b/js/foundation.responsiveToggle.js index 89b36815b..5410ee843 100644 --- a/js/foundation.responsiveToggle.js +++ b/js/foundation.responsiveToggle.js @@ -22,11 +22,6 @@ function ResponsiveToggle(element, options) { this._events(); Foundation.registerPlugin(this); - // /** - // * Fires when the plugin has been successfully initialized. - // * @event ResponsiveToggle#init - // */ - // this.$element.trigger('init.zf.ResponsiveToggle'); } ResponsiveToggle.defaults = { @@ -36,7 +31,7 @@ ResponsiveToggle.defaults = { * @example 'medium' */ hideFor: 'medium' -} +}; /** * Initializes the tab bar by finding the target element, toggling element, and running update(). @@ -53,7 +48,7 @@ ResponsiveToggle.prototype._init = function() { this.$toggler = this.$element.find('[data-toggle]'); this._update(); -} +}; /** * Adds necessary event handlers for the tab bar to work. @@ -66,7 +61,7 @@ ResponsiveToggle.prototype._events = function() { $(window).on('changed.zf.mediaquery', this._update.bind(this)); this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this)); -} +}; /** * Checks the current media query to determine if the tab bar should be visible or hidden. @@ -85,7 +80,7 @@ ResponsiveToggle.prototype._update = function() { this.$element.hide(); this.$targetMenu.show(); } -} +}; /** * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. @@ -102,8 +97,10 @@ ResponsiveToggle.prototype.toggleMenu = function() { */ this.$element.trigger('toggled.zf.responsiveToggle'); } -} - +}; +ResponsiveToggle.prototype.destroy = function(){ + //TODO this... +}; Foundation.plugin(ResponsiveToggle); -}(jQuery, Foundation) +}(jQuery, Foundation); diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index 5f54dbace..591f26448 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -30,11 +30,6 @@ // 'TAB': 'next', // 'SHIFT_TAB': 'previous' }); - // /** - // * Fires when the plugin has been successfuly initialized. - // * @event Tabs#init - // */ - // this.$element.trigger('init.zf.tabs'); } Tabs.defaults = { @@ -300,11 +295,6 @@ $(window).off('changed.zf.mediaquery'); } Foundation.unregisterPlugin(this); - // /** - // * Fires when the plugin has been destroyed. - // * @event Tabs#destroyed - // */ - // this.$element.trigger('destroyed.zf.tabs'); }; Foundation.plugin(Tabs); diff --git a/js/foundation.toggler.js b/js/foundation.toggler.js index b5c52210c..b2dcb808a 100644 --- a/js/foundation.toggler.js +++ b/js/foundation.toggler.js @@ -23,14 +23,14 @@ this._events(); Foundation.registerPlugin(this); - // /** - // * Fires when the plugin has been successfuly initialized. - // * @event Toggler#init - // */ - // this.$element.trigger('init.zf.toggler'); } Toggler.defaults = { + /** + * Tells the plugin if the element should animated when toggled. + * @option + * @example false + */ animate: false }; @@ -155,6 +155,7 @@ */ Toggler.prototype.destroy= function() { this.$element.off('.zf.toggler'); + Foundation.unregisterPlugin(this); }; Foundation.plugin(Toggler); diff --git a/js/foundation.tooltip.js b/js/foundation.tooltip.js index 90489f980..b1c0bb578 100644 --- a/js/foundation.tooltip.js +++ b/js/foundation.tooltip.js @@ -23,12 +23,6 @@ this._init(); Foundation.registerPlugin(this); - - // /** - // * Fires when the plugin has been successfully initialized - // * @event Tooltip#init - // */ - // this.$element.trigger('init.zf.tooltip'); } Tooltip.defaults = {