From 1a1615e0adc2755c9e06bb4188a6643b994a58ed Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Thu, 22 Feb 2024 15:52:40 -0800 Subject: [PATCH] Oops, fix regression of editor features on item lists page I changed the type of this tag without realizing the JS references it by both class and `div`! I think at the time this was a perf suggestion for jQuery, because the best way to query by class name was to query by tag first then filter? It's possible our jQuery still does this, but I don't imagine it's very relevant today, so I'll just remove that for better guarding against similar bugs in the future instead. --- app/assets/javascripts/closet_hangers/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/closet_hangers/index.js b/app/assets/javascripts/closet_hangers/index.js index 58283fa2..aea1d0c7 100644 --- a/app/assets/javascripts/closet_hangers/index.js +++ b/app/assets/javascripts/closet_hangers/index.js @@ -23,7 +23,7 @@ var hangerGroups = []; - $("div.closet-hangers-group").each(function () { + $(".closet-hangers-group").each(function () { var el = $(this); var lists = []; @@ -45,7 +45,7 @@ }; }); - $("div.closet-hangers-group span.toggle").live("click", function () { + $(".closet-hangers-group span.toggle").live("click", function () { $(this).closest(".closet-hangers-group").toggleClass("hidden"); }); @@ -112,7 +112,7 @@ onHangersInit(function () { // Super-lame hack to get the user ID from where it already is :/ var currentUserId = itemsSearchForm.data("current-user-id"); - $("#closet-hangers div.closet-hangers-group").each(function () { + $("#closet-hangers .closet-hangers-group").each(function () { var groupEl = $(this); var owned = groupEl.data("owned"); @@ -244,7 +244,7 @@ return $("#closet-list-" + id); } else { return $( - "div.closet-hangers-group[data-owned=" + + ".closet-hangers-group[data-owned=" + owned + "] div.closet-list.unlisted", ); @@ -615,7 +615,7 @@ for (var i in hangerGroups) { group = hangerGroups[i]; itemEl = $( - "div.closet-hangers-group[data-owned=" + + ".closet-hangers-group[data-owned=" + group.owned + "] div.object[data-item-id=" + item.id +