|
@@ -22,6 +22,11 @@ function setSpeed(what, speed) {
|
22
|
22
|
document.getElementById(what + '_' + speed).style.textDecoration = 'underline';
|
23
|
23
|
}
|
24
|
24
|
|
|
25
|
+function treeview_remove(id) {
|
|
26
|
+ var el = document.getElementById(id);
|
|
27
|
+ el.parentNode.removeChild(el);
|
|
28
|
+}
|
|
29
|
+
|
25
|
30
|
function treeview_add(name, id, type, parent) {
|
26
|
31
|
var parentNode;
|
27
|
32
|
|
|
@@ -400,6 +405,16 @@ function window_create(window, parent) {
|
400
|
405
|
onException:excFunc, onSuccess: handlerFunc})
|
401
|
406
|
}
|
402
|
407
|
|
|
408
|
+function window_close(id) {
|
|
409
|
+ treeview_remove(id);
|
|
410
|
+ windows.unset(id);
|
|
411
|
+
|
|
412
|
+ if (activeWindow == id) {
|
|
413
|
+ // TODO: Focus another window, or reset textview/title/etc if there
|
|
414
|
+ // are no more windows
|
|
415
|
+ }
|
|
416
|
+}
|
|
417
|
+
|
403
|
418
|
function window_show(id) {
|
404
|
419
|
treeview_setactive(id);
|
405
|
420
|
title_settext(windows.get(id).title)
|
|
@@ -483,6 +498,8 @@ function handlerFunc(transport) {
|
483
|
498
|
profiles_add(event.arg1);
|
484
|
499
|
} else if (event.type == 'newwindow') {
|
485
|
500
|
window_create(event.arg1);
|
|
501
|
+ } else if (event.type == 'closewindow') {
|
|
502
|
+ window_close(event.arg1);
|
486
|
503
|
} else if (event.type == 'newchildwindow') {
|
487
|
504
|
window_create(event.arg1[1], event.arg1[0]);
|
488
|
505
|
} else if (event.type == 'clearwindow') {
|