Вот как мой код выглядит сейчас:
Код: Выделить всё
(($) => {
$.fn.toggleActive = function(active) {
this.toggleClass("active", active);
this.children(".data__form-activator").toggle(!active);
this.children(".data__form-btn").toggleClass("visible", active);
this.children(".data__flex-row").toggleClass("_m-none", !active);
this.find("input, select").prop("disabled", !active);
return this;
};
$.fn.activate = function() {
return this.toggleActive(true);
};
$.fn.deactivate = function() {
return this.toggleActive(false);
};
})(jQuery);
Заранее спасибо!
Подробнее здесь: https://stackoverflow.com/questions/793 ... ery-plugin
Мобильная версия