From f718cfd2566b71ab8a34774ab2c4a50da5d75bb2 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 7 Dec 2005 20:08:37 +0000 Subject: [PATCH] added setTable() --- js/querywindow.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/querywindow.js b/js/querywindow.js index 041b0821f..7f7856410 100644 --- a/js/querywindow.js +++ b/js/querywindow.js @@ -23,6 +23,29 @@ function setDb( new_db ) { } } +/** + * sets current selected server, table and db (called from libraries/footer.inc.php) + */ +function setTable( new_table ) { + //alert('setTable(' + new_table + ')'); + if ( new_table != table ) { + // table has changed + //alert( new_table + '(' + new_table.length + ') : ' + table ); + + table = new_table; + + if ( window.frames[0].document.getElementById( db + '.' + table ) == null ) { + // table is unknown, reload complete left frame + refreshLeft(); + + } + // TODO: add code to expand table in lightview mode + + // refresh querywindow + refreshQuerywindow(); + } +} + function refreshMain( url ) { if ( ! url ) { if ( db ) { @@ -192,6 +215,7 @@ function goTo( targeturl, target ) { function openDb( new_db ) { //alert('opendb(' + new_db + ')'); setDb( new_db ); + setTable( '' ); refreshMain( opendb_url ); return true; }