/**
* 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);
$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.
_this.removeErrorClasses($(this));
});
}
+ /**
+ * Destroy the Abide instance
+ * @function
+ */
+ destroy() { super.destroy(); } // here for docs purposes only
}
/**
/**
* 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);
}
/**
- * 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 = {