fix exports into attachments for event resources
authorCornelius Weiß <c.weiss@metaways.de>
Wed, 26 Jul 2017 12:00:54 +0000 (14:00 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Wed, 26 Jul 2017 12:06:36 +0000 (14:06 +0200)
Change-Id: I7f210991f3bc54466f2c42780a152817e1c2d479
Reviewed-on: http://gerrit.tine20.com/customers/5324
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Calendar/js/AttendeeGridPanel.js
tine20/Tinebase/js/widgets/ActionUpdater.js

index 20700b4..90bd456 100644 (file)
@@ -575,10 +575,6 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
                     Tine.widgets.exportAction.SCOPE_SINGLE
                 );
 
-                var actionUpdater = new Tine.widgets.ActionUpdater();
-                actionUpdater.addAction(exportAction);
-                actionUpdater.updateActions([resource]);
-
                 items = items.concat(exportAction);
             }
 
@@ -608,6 +604,11 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
                     }
                 }
             });
+
+            var actionUpdater = new Tine.widgets.ActionUpdater();
+            actionUpdater.addAction(exportAction);
+            actionUpdater.updateActions([resource]);
+
             this.ctxMenu.showAt(e.getXY());
         }
     },
index e6da761..bbcaaf0 100644 (file)
      * @param {Array|Toolbar} actions
      */
     addActions: function(actions) {
-        switch (typeof(actions)) {
-            case 'object':
-                if (typeof(actions.each) == 'function') {
-                    actions.each(this.addAction, this);
-                } else {
-                    for (var action in actions) {
-                        this.addAction(actions[action]);
-                    }
-                }
-            break;
-            case 'array':
-                for (var i=0; i<actions.length; i++) {
-                    this.addAction(actions[i]);
-                }
-            break;
+        if (Ext.isArray(actions)) {
+            for (var i=0; i<actions.length; i++) {
+                this.addAction(actions[i]);
+            }
+        } else if (Ext.isFunction(actions.each)) {
+            actions.each(this.addAction, this);
+        } else if (Ext.isObject(actions)) {
+            for (var action in actions) {
+                this.addAction(actions[action]);
+            }
         }
     },