diff --git a/structr-rest/src/main/java/org/structr/rest/serialization/StructrJsonHtmlWriter.java b/structr-rest/src/main/java/org/structr/rest/serialization/StructrJsonHtmlWriter.java
index <HASH>..<HASH> 100644
--- a/structr-rest/src/main/java/org/structr/rest/serialization/StructrJsonHtmlWriter.java
+++ b/structr-rest/src/main/java/org/structr/rest/serialization/StructrJsonHtmlWriter.java
@@ -112,7 +112,7 @@ public class StructrJsonHtmlWriter implements RestWriter {
 
 		head.inline("title").text(baseUrl);
 
-		Tag body = doc.block("body").attr(new Onload("CollapsibleLists.apply(true);"));
+		Tag body = doc.block("body").attr(new Onload("if (document.querySelectorAll('#right > ul > li > ul > li > ul.collapsibleList > li').length > 5) { CollapsibleLists.apply(true); }"));
 		Tag top  = body.block("div").id("top");
 
 		final App app  = StructrApp.getInstance(securityContext);
Feature: When displaying five or less objects via the JSON HTML Resource we don't automatically collapse the objects (inspired by #<I>)