[pve-devel] [PATCH manager] prevent infinite loop in edit window

Dominik Csapak d.csapak at proxmox.com
Fri Jul 15 15:54:07 CEST 2016


on touch devices, the isValid function of forms trigger
a layout event, which the edit window listens to and
executes an isValid on the form -> infinite loop

we now suspend the layout before this and continue afterwards

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/Edit.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/www/manager6/window/Edit.js b/www/manager6/window/Edit.js
index b231003..0f9c611 100644
--- a/www/manager6/window/Edit.js
+++ b/www/manager6/window/Edit.js
@@ -255,7 +255,14 @@ Ext.define('PVE.window.Edit', {
 
 	// always mark invalid fields
 	me.on('afterlayout', function() {
+	    // on touch devices, the isValid function
+	    // triggers a layout, which triggers an isValid
+	    // and so on
+	    // to prevent this we disable the layouting here
+	    // and enable it afterwards
+	    me.suspendLayout = true;
 	    me.isValid();
+	    me.suspendLayout = false;
 	});
     }
 });
-- 
2.1.4




More information about the pve-devel mailing list