[pve-devel] r5822 - pve-manager/pve2/www/new

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Apr 19 10:37:28 CEST 2011


Author: dietmar
Date: 2011-04-19 10:37:28 +0200 (Tue, 19 Apr 2011)
New Revision: 5822

Modified:
   pve-manager/pve2/www/new/StateProvider.js
Log:
set reasonable defaults


Modified: pve-manager/pve2/www/new/StateProvider.js
===================================================================
--- pve-manager/pve2/www/new/StateProvider.js	2011-04-19 07:39:37 UTC (rev 5821)
+++ pve-manager/pve2/www/new/StateProvider.js	2011-04-19 08:37:28 UTC (rev 5822)
@@ -30,8 +30,14 @@
 	    'ctab'
 	];
 
+	var defaults = {
+	    view: 'server',
+	    ltab: 'clog',
+	    ctab: 'search'
+	};
+
 	Ext.Array.each(list, function(name) {
-	    self.UIState[name] = null;
+	    self.UIState[name] = defaults[name] || null;
 	});
 
 	var history_change_cb = function(token) {
@@ -53,7 +59,8 @@
 		var oldtext = Ext.encode(oldvalue);
 		if (newtext != oldtext) {
  		    self.UIState[name] = newstate[name];
-		    //console.log("changed " + name + " " + newtext);
+		    //console.log("changed old " + name + " " + oldtext);
+		    //console.log("changed new " + name + " " + newtext);
 		    self.fireEvent("statechange", self, name, newvalue);
 		}
 	    });
@@ -103,6 +110,8 @@
 
 	//console.log("SET " + name + " " + Ext.encode(value));
 	if (typeof self.UIState[name] != "undefined") {
+	    if (name !== 'rid' && !self.UIState.rid)
+		return;
 	    var cstate = Ext.clone(self.UIState);
 	    cstate[name] = value ? value.value : null;
 	    var htext = Ext.urlEncode(cstate);




More information about the pve-devel mailing list