Skip to content

Instantly share code, notes, and snippets.

@pjanik
Created May 20, 2015 14:45
Show Gist options
  • Save pjanik/318360ecaf43a44301b0 to your computer and use it in GitHub Desktop.
Save pjanik/318360ecaf43a44301b0 to your computer and use it in GitHub Desktop.
<div id="bin-view"></div>
<script>
var MATERIALS = [
{
category: "Cat A",
children: [
{
category: "Cat A1",
children: [
{
category: "Cat A11",
children: [
{
collections: [
{id: 2},
{id: 2}
]
}
]
},
{
category: "Cat A12",
children: [
{
collections: [
{id: 3},
{id: 4}
]
}
]
}
]
},
{
category: "Cat A2",
children: [
{
category: "Cat A21",
children: [
{
collections: [
{id: 3},
{id: 4}
]
}
]
},
{
category: "Cat A22",
children: [
{
collections: [
{id: 3}
]
}
]
}
]
}
]
},
{
category: "Cat B",
children: [
{
category: "Cat B1 (login required)",
loginRequired: true,
children: [
{
category: "Cat B11",
children: [
{
collections: [
{id: 2},
{id: 2}
]
}
]
},
{
category: "Cat B12",
children: [
{
collections: [
{id: 3},
{id: 4}
]
}
]
}
]
},
{
category: "Cat B2",
children: [
{
category: "Cat B21 (login required)",
loginRequired: true,
children: [
{
collections: [
{id: 3},
{id: 4}
]
}
]
},
{
category: "Cat B22",
children: [
{
collections: [
{id: 4}
]
}
]
}
]
}
]
},
{
category: "Cat C",
children: [
{
category: "Cat C1",
children: [
{
category: "Cat C11",
children: [
{
collections: [
{id: 2},
{id: 2}
]
}
]
},
{
category: "Cat C12",
children: [
{
collections: [
{id: 3},
{id: 4}
]
}
]
}
]
},
{
category: "Cat C2",
children: [
{
category: "Cat C21",
children: [
{
collections: [
{id: 2},
{id: 2}
]
}
]
},
{
category: "Cat C22",
children: [
{
collections: [
{id: 4}
]
}
]
}
]
}
]
}
];
Portal.renderMaterialsBin(MATERIALS, '#bin-view');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment