fix emptyClass layout handling
authorCornelius Weiß <c.weiss@metaways.de>
Fri, 7 Jul 2017 06:08:36 +0000 (08:08 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Fri, 7 Jul 2017 06:08:46 +0000 (08:08 +0200)
Change-Id: I4394dd8f69b783ae00331e6324bab342a80a6abc
Reviewed-on: http://gerrit.tine20.com/customers/5051
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Tinebase/js/widgets/form/RecordsPickerCombo.js

index 07f9734..359fe09 100644 (file)
@@ -75,10 +75,11 @@ Tine.Tinebase.widgets.form.RecordsPickerCombo = Ext.extend(Ext.ux.form.LayerComb
         value = value || [];
         this.setStoreFromArray(value);
         if (this.rendered) {
         value = value || [];
         this.setStoreFromArray(value);
         if (this.rendered) {
-            var titles = _.reduce(this.store.data.items, function(result, record) {
+            var text = _.reduce(this.store.data.items, function(result, record) {
                 return result.concat(record.getTitle());
                 return result.concat(record.getTitle());
-            }, []);
-            this.setRawValue(titles.join(', ') || this.emptyText);
+            }, []).join(', ');
+            this.setRawValue(text || this.emptyText);
+            this.el[(text ? 'remove' : 'add') + 'Class'](this.emptyClass);
         }
         this.currentValue = value;
 
         }
         this.currentValue = value;