File size: 680B
!function($, window, document)
{
"use strict";
XF.CustomToggle = XF.Click.newHandler({
eventNameSpace: 'XFCustomToggleClick',
options: {
target: '',
type: ''
},
init: function() {
this.$target = $(this.options.target);
},
click: function() {
if (!this.isVisible())
{
this.$target.closest('.block-body').find('.is-active').hide().removeClass('is-active');
this.$target.show().addClass('is-active');
}
},
isVisible: function() {
return this.$target.hasClass('is-active');
}
});
XF.Click.register('custom-toggle', 'XF.CustomToggle');
}
(window.jQuery, window, document);