[pve-devel] r5846 - in pve-manager/pve2/www/new: . panel

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Apr 21 11:15:40 CEST 2011


Author: dietmar
Date: 2011-04-21 11:15:40 +0200 (Thu, 21 Apr 2011)
New Revision: 5846

Modified:
   pve-manager/pve2/www/new/StateProvider.js
   pve-manager/pve2/www/new/panel/ConfigPanel.js
   pve-manager/pve2/www/new/panel/Datacenter.js
Log:
do not use window.onbeforeunload


Modified: pve-manager/pve2/www/new/StateProvider.js
===================================================================
--- pve-manager/pve2/www/new/StateProvider.js	2011-04-21 08:34:50 UTC (rev 5845)
+++ pve-manager/pve2/www/new/StateProvider.js	2011-04-21 09:15:40 UTC (rev 5846)
@@ -1,12 +1,3 @@
-// display message on page unload
-PVE.StopPageUnload = false;
-PVE.PageUnloadMessFn = function (){
-    var mess = "Are you sure you want to navigate away from this page?";
-    if (PVE.StopPageUnload)
-	return mess;
-}
-window.onbeforeunload = PVE.PageUnloadMessFn;
-
 /* This state provider keeps part of the state inside
  * the browser history.
  *
@@ -75,12 +66,16 @@
 	var history_change_cb = function(token) {
 	    //console.log("HC " + token);
 	    if (!token) {
-		PVE.StopPageUnload = true;
-		Ext.History.back();
-		Ext.History.forward();
+		var res = confirm('Are you sure you want to navigate away from this page?');
+		if (res){
+		    // process text value and close...
+		    Ext.History.back();
+		} else {
+		    Ext.History.forward();
+		}
 		return;
 	    }
-	    PVE.StopPageUnload = false;
+
 	    var newstate = Ext.urlDecode(token);
 	    Ext.Array.each(list, function(name) {
 		if (typeof newstate[name] == "undefined")

Modified: pve-manager/pve2/www/new/panel/ConfigPanel.js
===================================================================
--- pve-manager/pve2/www/new/panel/ConfigPanel.js	2011-04-21 08:34:50 UTC (rev 5845)
+++ pve-manager/pve2/www/new/panel/ConfigPanel.js	2011-04-21 09:15:40 UTC (rev 5846)
@@ -42,7 +42,7 @@
 		    var ntab = newcard.itemId;
 		    // Note: '' is alias for first tab.
 		    // First tab can be 'search' or something else
-		    if (newcard.itemId === 'search')
+		    if (newcard.itemId === items[0].itemId)
 			ntab = '';
 		    var state = { value: ntab };
 		    if (stateid) {

Modified: pve-manager/pve2/www/new/panel/Datacenter.js
===================================================================
--- pve-manager/pve2/www/new/panel/Datacenter.js	2011-04-21 08:34:50 UTC (rev 5845)
+++ pve-manager/pve2/www/new/panel/Datacenter.js	2011-04-21 09:15:40 UTC (rev 5846)
@@ -32,7 +32,7 @@
 		{
 		    //xtype: 'pveACLView',
 		    title: 'Permissions',
-		    itemId: 'permissions',
+		    itemId: 'permissions'
 		},
 		{
 		    //xtype: 'pveRoleView',



More information about the pve-devel mailing list