Accordion for login methods on login page

This commit is contained in:
JonnyWong16 2018-07-02 15:56:24 -07:00
parent 5c7a3a12e9
commit b65e6a39a0
3 changed files with 79 additions and 43 deletions

View file

@ -351,21 +351,26 @@ function getCookie(cname) {
}
return "";
}
var Accordion = function (el, multiple) {
var Accordion = function (el, multiple, close) {
this.el = el || {};
this.multiple = multiple || false;
this.close = (close === undefined) ? true : close;
// Variables privadas
var links = this.el.find('.link');
// Evento
links.on('click', {
el: this.el,
multiple: this.multiple
multiple: this.multiple,
close: this.close
}, this.dropdown);
};
Accordion.prototype.dropdown = function (e) {
var $el = e.data.el;
$this = $(this);
$next = $this.next();
if (!e.data.close && $this.parent().hasClass('open')) {
return
}
$next.slideToggle();
$this.parent().toggleClass('open');
if (!e.data.multiple) {