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

vmi.js : add vmi.View.on bool

parent 8dc1938b
......@@ -20,10 +20,13 @@ vmi.View = function(id, parentId, classes) {
this.node = node;
// parent.appendChild(node);
this.on = false; // boolean telling whether the view is active or not
// vmi.setView(this);
}
vmi.setView = function(view, panel) {
if (panel) view.parentId = panel;
view.on = true;
document.getElementById(view.parentId).appendChild(view.node);
}
......@@ -78,7 +81,10 @@ vmi.setMenuOptions = function() {
div.className = "editor";
div.onclick = function() {
var v = vmi.selectedView;
if (v) v.node.parentNode.removeChild(v.node);
if (v) {
v.on = false;
v.node.parentNode.removeChild(v.node);
}
vmi.hideEditors();
}
menu.appendChild(div);
......
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