From 61056359f46f7c33b1ddfc1404f04f44a7742981 Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Wed, 28 Jun 2017 15:47:16 -0700 Subject: [PATCH] Fix autodoc for abide and accordion --- js/foundation.abide.js | 16 +++++++++++++++- js/foundation.accordion.js | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/js/foundation.abide.js b/js/foundation.abide.js index a2609c6f5..cbfe993c9 100644 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@ -12,10 +12,15 @@ class Abide extends Plugin { /** * Creates a new instance of Abide. * @class - * @fires Abide#init * @param {Object} element - jQuery object to add the trigger to. * @param {Object} options - Overrides to the default plugin settings. */ + constructor(element, options = {}) { super(element, options); } + + /** + * Fires when the plugin has initialized + * @event Abide#init + */ _setup(element, options = {}) { this.$element = element; this.options = $.extend({}, Abide.defaults, this.$element.data(), options); @@ -449,6 +454,10 @@ class Abide extends Plugin { $form.trigger('formreset.zf.abide', [$form]); } + /** + * Fires when the plugin has been destroyed. + * @event Abide#destroyed + */ /** * Destroys an instance of Abide. * Removes error styles and classes from elements, without resetting their values. @@ -466,6 +475,11 @@ class Abide extends Plugin { _this.removeErrorClasses($(this)); }); } + /** + * Destroy the Abide instance + * @function + */ + destroy() { super.destroy(); } // here for docs purposes only } /** diff --git a/js/foundation.accordion.js b/js/foundation.accordion.js index 48c42f5fa..69dacd479 100644 --- a/js/foundation.accordion.js +++ b/js/foundation.accordion.js @@ -15,10 +15,15 @@ class Accordion extends Plugin { /** * Creates a new instance of an accordion. * @class - * @fires Accordion#init * @param {jQuery} element - jQuery object to make into an accordion. * @param {Object} options - a plain object with settings to override the default options. */ + constructor(element, options = {}) { super(element, options); } // here for doc purposes only + + /** + * Fires when the plugin has initialized + * @event Accordion#init + */ _setup(element, options) { this.$element = element; this.options = $.extend({}, Accordion.defaults, this.$element.data(), options); @@ -256,18 +261,23 @@ class Accordion extends Plugin { } /** - * Destroys an instance of an accordion. - * @fires Accordion#destroyed - * @function + * Fires when the plugin has been destroyed. + * @event Accordion#destroyed */ + _destroy() { this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', ''); this.$element.find('a').off('.zf.accordion'); if(this.options.deepLink) { $(window).off('popstate', this._checkDeepLink); } - } + /** + * Destroy the Accordion instance + * @function + */ + destroy() { super.destroy(); } // here for docs purposes only + } Accordion.defaults = { -- 2.47.2