From 5db841cbaafe2d4f4bfe9009f5ecca996f21b4d3 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 25 Sep 2020 22:06:12 +0200 Subject: Require jQuery using composer --- ratatoeskr/js/backend.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'ratatoeskr/js') diff --git a/ratatoeskr/js/backend.js b/ratatoeskr/js/backend.js index 8b60c2d..cb276b1 100644 --- a/ratatoeskr/js/backend.js +++ b/ratatoeskr/js/backend.js @@ -1,16 +1,11 @@ -$(function() -{ - $("div.articleeditor-metabar-element h2").addClass("metabar_element_expanded").click(function() - { - self = $(this); - if(self.hasClass("metabar_element_expanded")) - { +$(function() { + $("div.articleeditor-metabar-element h2").addClass("metabar_element_expanded").on("click", function() { + var self = $(this); + if (self.hasClass("metabar_element_expanded")) { self.removeClass("metabar_element_expanded"); self.addClass("metabar_element_collapsed"); $("div.articleeditor-metabar-element-content", self.parent()).hide("fast"); - } - else - { + } else { self.removeClass("metabar_element_collapsed"); self.addClass("metabar_element_expanded"); $("div.articleeditor-metabar-element-content", self.parent()).show("fast"); -- cgit v1.2.3-70-g09d2