forked from extern/egroupware
Toggle save as for multiple based on selection (no directory) and browser support
This commit is contained in:
parent
d0b80697c2
commit
4d5b7540bd
@ -125,10 +125,11 @@ class filemanager_ui
|
|||||||
'saveas' => array(
|
'saveas' => array(
|
||||||
'caption' => lang('Save as'),
|
'caption' => lang('Save as'),
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'allowOnMultiple' => false,
|
'allowOnMultiple' => true,
|
||||||
'icon' => 'filesave',
|
'icon' => 'filesave',
|
||||||
'onExecute' => 'javaScript:app.filemanager.force_download',
|
'onExecute' => 'javaScript:app.filemanager.force_download',
|
||||||
'disableClass' => 'isDir',
|
'disableClass' => 'isDir',
|
||||||
|
'enabled' => 'javaScript:app.filemanager.is_multiple_allowed'
|
||||||
),
|
),
|
||||||
'edit' => array(
|
'edit' => array(
|
||||||
'caption' => lang('Edit settings'),
|
'caption' => lang('Edit settings'),
|
||||||
|
@ -477,6 +477,23 @@ app.classes.filemanager = AppJS.extend(
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check to see if the browser supports downloading multiple files
|
||||||
|
* (using a tag download attribute) to enable/disable the context menu
|
||||||
|
*
|
||||||
|
* @param {egwAction} action
|
||||||
|
* @param {egwActionObject[]} selected
|
||||||
|
*/
|
||||||
|
is_multiple_allowed: function(action, selected)
|
||||||
|
{
|
||||||
|
var allowed = typeof document.createElement('a').download != "undefined";
|
||||||
|
|
||||||
|
if(typeof action == "undefined") return allowed;
|
||||||
|
|
||||||
|
return (allowed || selected.length <= 1) && action.not_disableClass.apply(action, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change directory
|
* Change directory
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user