diff --git a/exec/load/layout.js b/exec/load/layout.js index 69346c744709f63203eeb94298160fdc303608c6..c601031d8915e2e22ca53783bfecd71e9f5c0821 100644 --- a/exec/load/layout.js +++ b/exec/load/layout.js @@ -171,6 +171,29 @@ function Layout(frame) { properties.views.push(v); return v; } + this.delView=function(title_or_index) { + var view = false; + if(isNaN(title_or_index)) { + for(var v=0;v<properties.views.length;v++) { + if(properties.views[v].title.toUpperCase() == title_or_index.toUpperCase()) { + view = properties.views[v]; + properties.views.splice(v,1); + } + } + } + else if(properties.views[title_or_index]) { + tab = properties.views[title_or_index]; + properties.views.splice(title_or_index,1); + } + if(view) { + view.frame.delete(); + while(!properties.views[properties.index] && properties.index > 0) + properties.index--; + if(this.current) + this.current.active=true; + } + return view; + } this.draw=function() { for each(var view in properties.views) view.draw(); @@ -370,8 +393,9 @@ function LayoutView(title,frame,parent) { if(typeof t.open == "function") t.open(); } - this.current=0; setViewFrames(); + this.current=0; + this.frame.open(); if(typeof this.onOpen == "function") this.onOpen(); } @@ -426,7 +450,7 @@ function LayoutView(title,frame,parent) { var tab = false; if(isNaN(title_or_index)) { for(var t=0;t<properties.tabs.length;t++) { - if(properties.tabs[t].title.toUpperCase() == title.toUpperCase()) { + if(properties.tabs[t].title.toUpperCase() == title_or_index.toUpperCase()) { tab = properties.tabs[t]; properties.tabs.splice(t,1); }