|
Hi I have a JS file, for a JS windowing script, I am trying to combine (kinda) 2 functions and need some help.
function 1:
function jsWMLoadWindow(url) {
var window_id;
// Do we have any free windows left in the list?
if(this.free_windows.length < 1) {
var new_id = this.windows.length;
// Create the required HTML for a new window and spit it out
// into the page body. *NOTE* This only creates the outer DIV
// element shell, we rely on the jsWindow.create to create
// the inner content of the html "window"
// document.body.innerHTML += '<div id="window' + new_id + '" class="win" ' +
// 'onClick="WindowManager.setFocus('+new_id+')"></div>';
var new_window = this.new_window(new_id);
window_id = new_id;
} else {
window_id = this.free_windows.pop();
}
// FOCUS NEW WINDOWS
this.set_focus(window_id);
// SHOW IT
//this.windows[window_id].div_elem = document.getElementById("window"+window_id);
//div_elem = document.getElementById("window"+new_id);
this.windows[window_id].div_elem.style.left = 0; // + "px";
this.windows[window_id].div_elem.style.top = 0; // + "px";
this.windows[window_id].div_elem.style.display = "block";
document.getElementById("window"+window_id).style. display = "block";
document.getElementById("windowinner"+window_id).i nnerHTML = window_id;
//this.windows[window_id].div_elem.innerHTML =window_id;
}
and function 2:
function jsWMMinimizeWindow(win_id) {
var window_title = document.getElementById("windowtitle"+win_id).inne rHTML;
// add an entry to the icon bar
this.iconbar.add_item(win_id, window_title);
// finally we hide the window
document.getElementById("window"+win_id).style.dis play = 'none';
}
what i want to do is add the:
var window_title = document.getElementById("windowtitle"+win_id).inne rHTML;
// add an entry to the icon bar
this.iconbar.add_item(win_id, window_title);
to the first script so as to minamize the JS window but keep is visable when it loads.
|