Commit 12945394 authored by Téo Vasseur's avatar Téo Vasseur

css/js : set view id, and use as inner text

parent d73867ef
......@@ -81,6 +81,9 @@ div {
.view {
font-size: 2em;
text-align: center;
color: white;
min-width: 400px;
min-height: 200px;
border: 3px solid #ccc;
function View(parentId, classes) {
function View(id, parentId, classes) {
this.parentId = parentId; = id;
var parent = document.getElementById(parentId);
var view = document.createElement('div');
view.className = "view " + classes;
view.textContent = id;
function Flex(parentId) {, parentId, "flex");
function Flex(id, parentId) {, id, parentId, "flex");
function Solid1(parentId) {, parentId, "solid1");
function Solid1(id, parentId) {, id, parentId, "solid1");
function Solid2(parentId) {, parentId, "solid2");
function Solid2(id, parentId) {, id, parentId, "solid2");
function main() {
// new Flex('A');
new Flex('A');
new Flex('B');
new Flex('C');
new Flex("v1", 'A');
// new Flex("v2", 'A');
new Flex("v3", 'B');
new Flex("v4", 'C');
new Solid1('A');
new Solid2('B');
new Solid1("v5", 'A');
new Solid2("v6", 'B');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment