@@ -882,6 +882,7 @@ ownCloudZimlet.prototype.addMenuButton = function (controller , menu) {
882
882
index : moveOpIndex + 1
883
883
} ;
884
884
var mi = menu . createOp ( ID , params ) ;
885
+ menu . addPopupListener ( new AjxListener ( this , this . _onRightClickMenu , [ controller , menu ] ) ) ;
885
886
mi . addSelectionListener ( new AjxListener ( this , this . _menuButtonListener , controller ) ) ;
886
887
}
887
888
} ;
@@ -904,6 +905,27 @@ ownCloudZimlet.prototype._menuButtonListener = function (controller) {
904
905
zimletInstance . targetFolderPicker ( zimletInstance . _doDropPropfindCbk , [ items ] ) ;
905
906
} ;
906
907
908
+
909
+ /**
910
+ * Listener called when the menu pops up, changes the buttons depending on the number of selected items
911
+ * @param controller
912
+ * @param actionMenu
913
+ */
914
+ ownCloudZimlet . prototype . _onRightClickMenu = function ( controller , actionMenu ) {
915
+ var menu = actionMenu . getMenuItem ( "ownCloudZimlet_MENU_ITEM" ) . _menu ;
916
+
917
+ /* Here you can get the number of selected items, to make the menu do different things based on single/multiselect
918
+ * we do not need it now, as we just want to enable the menu for all possible selections
919
+ var selected = controller.getListView().getDnDSelection()
920
+ selected = (selected instanceof Array) ? selected : [selected];
921
+ selected = selected.length;*/
922
+
923
+ // default behaviour is disable for more than one, changed here
924
+ actionMenu . enable ( "ownCloudZimlet_MENU_ITEM" , true ) ;
925
+
926
+
927
+ } ;
928
+
907
929
/**
908
930
* Handle the action 'drop' on the Zimlet Menu Item.
909
931
* @param {ZmItem[] } zmObjects Objects dropped on the Zimlet Menu Item.
@@ -967,12 +989,12 @@ ownCloudZimlet.prototype._doDropPropfindCbk = function(zmObjects, callback, erro
967
989
msgObj = msgObj . getFirstHotMsg ( ) ;
968
990
tmpObj . id = msgObj . id ;
969
991
type = 'MESSAGE' ;
970
- fileName = ( tmpObj . subject ? tmpObj . subject + '.eml' : tmpObj . id + '.eml' ) ;
992
+ fileName = ( tmpObj . subject ? tmpObj . subject + ' ' + tmpObj . id + ' .eml' : tmpObj . id + '.eml' ) ;
971
993
}
972
994
973
995
if ( tmpObj . type === 'MSG' )
974
996
{
975
- fileName = ( tmpObj . subject ? tmpObj . subject + '.eml' : tmpObj . id + '.eml' ) ;
997
+ fileName = ( tmpObj . subject ? tmpObj . subject + ' ' + tmpObj . id + '.eml' : tmpObj . id + '.eml' ) ;
976
998
}
977
999
978
1000
if ( tmpObj . id < 0 ) {
0 commit comments