]> git.proxmox.com Git - pve-manager.git/commitdiff
correctly reset value of combobox
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 6 Oct 2016 10:10:26 +0000 (12:10 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 7 Oct 2016 06:34:11 +0000 (08:34 +0200)
we have cases, were the original value of a combobox is an array,
but not the current value

on reset, we get an error in Ext.Array.equals, because we
did not check if the current value is also an array

this patch fixes this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Toolkit.js

index 7bef6f21245e292be2160458977fb04c35a7b713..4640bc0eb04f9c469674533af291f81126f9ae62 100644 (file)
@@ -172,7 +172,8 @@ Ext.define('PVE.form.ComboBox', {
        me.applyEmptyText();
 
        // clear and set when not the same
-       if (Ext.isArray(me.originalValue) && !Ext.Array.equals(me.getValue(), me.originalValue)) {
+       var value = me.getValue();
+       if (Ext.isArray(me.originalValue) && Ext.isArray(value) && !Ext.Array.equals(value, me.originalValue)) {
            me.clearValue();
            me.setValue(me.originalValue);
        }