Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created December 19, 2022 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocodesupplyco/672d6fbad00ed8e74692dd1dd2c1e8c8 to your computer and use it in GitHub Desktop.
Save nocodesupplyco/672d6fbad00ed8e74692dd1dd2c1e8c8 to your computer and use it in GitHub Desktop.
Inline Merge and Nest Collection Lists
$(function () {
for (var i = 0; i < $(".tr-wrap .tr-category").length; i++) {
var name = $(".tr-wrap .tr-category").eq(i);
for (var d = 0; d < $(".tr-title").length; d++) {
var title = $(".tr-title").eq(d);
if (title.text() == name.text()) {
var parent = name.closest(".tr-item");
var titleContain = title.closest(".tr-contain").find(".tr-list");
parent.clone(true, true).appendTo(titleContain);
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment