mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-01 03:29:05 +01:00
Et2Link: Fix editable files were downloaded instead of opened in Collabora
This commit is contained in:
parent
f2ebd369ef
commit
6034702a7c
@ -169,6 +169,15 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
|
|||||||
let data = {};
|
let data = {};
|
||||||
if (mime_info)
|
if (mime_info)
|
||||||
{
|
{
|
||||||
|
if (this.isEditable(_type))
|
||||||
|
{
|
||||||
|
data = {
|
||||||
|
'menuaction': 'collabora.EGroupware\\collabora\\Ui.editor',
|
||||||
|
'path': path,
|
||||||
|
'cd': 'no' // needed to not reload framework in sharing
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
for(let attr in mime_info)
|
for(let attr in mime_info)
|
||||||
{
|
{
|
||||||
switch(attr)
|
switch(attr)
|
||||||
@ -517,6 +526,25 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
|
|||||||
select.dropdown.trigger.style.height = '0px';
|
select.dropdown.trigger.style.height = '0px';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a mimetype is editable
|
||||||
|
*
|
||||||
|
* Check mimetype & user preference
|
||||||
|
*/
|
||||||
|
isEditable: function (mime)
|
||||||
|
{
|
||||||
|
if (!mime)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let fe = egw_get_file_editor_prefered_mimes(mime);
|
||||||
|
if (!fe || !fe.mime || fe && fe.mime && !fe.mime[mime])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ['edit'].indexOf(fe.mime[mime].name) !== -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user