Skip to content
Snippets Groups Projects
Commit 62481cf4 authored by mcmlxxix's avatar mcmlxxix
Browse files

added dynamic LayoutView creation... not sure why this wasnt in there from the start...

parent 0703079c
No related branches found
No related tags found
No related merge requests found
...@@ -171,6 +171,29 @@ function Layout(frame) { ...@@ -171,6 +171,29 @@ function Layout(frame) {
properties.views.push(v); properties.views.push(v);
return 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() { this.draw=function() {
for each(var view in properties.views) for each(var view in properties.views)
view.draw(); view.draw();
...@@ -370,8 +393,9 @@ function LayoutView(title,frame,parent) { ...@@ -370,8 +393,9 @@ function LayoutView(title,frame,parent) {
if(typeof t.open == "function") if(typeof t.open == "function")
t.open(); t.open();
} }
this.current=0;
setViewFrames(); setViewFrames();
this.current=0;
this.frame.open();
if(typeof this.onOpen == "function") if(typeof this.onOpen == "function")
this.onOpen(); this.onOpen();
} }
...@@ -426,7 +450,7 @@ function LayoutView(title,frame,parent) { ...@@ -426,7 +450,7 @@ function LayoutView(title,frame,parent) {
var tab = false; var tab = false;
if(isNaN(title_or_index)) { if(isNaN(title_or_index)) {
for(var t=0;t<properties.tabs.length;t++) { 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]; tab = properties.tabs[t];
properties.tabs.splice(t,1); properties.tabs.splice(t,1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment