Add download file from contextmenu in code and slide apps

pull/1/head
ClemDee 5 years ago
parent 73051ad30f
commit fb2da27115

@ -2854,10 +2854,14 @@ define([
'aria-labelledBy': 'dropdownMenu',
'style': 'display:block;position:static;margin-bottom:5px;'
}, [
h('li', h('a.dropdown-item', {
h('li', h('a.cp-app-drive-context-saveindrive.dropdown-item', {
'tabindex': '-1',
'data-icon': "fa-cloud-upload",
}, Messages.pad_mediatagImport))
}, Messages.pad_mediatagImport)),
h('li', h('a.cp-app-drive-context-download.dropdown-item', {
'tabindex': '-1',
'data-icon': "fa-download",
}, Messages.download_mt_button)),
])
]);
$(menu).find("li a.dropdown-item").each(function (i, el) {
@ -2879,7 +2883,13 @@ define([
e.stopPropagation();
m.hide();
var $mt = $menu.data('mediatag');
common.importMediaTag($mt);
if ($(this).hasClass("cp-app-drive-context-saveindrive")) {
common.importMediaTag($mt);
}
else if ($(this).hasClass("cp-app-drive-context-download")) {
var media = $mt[0]._mediaObject;
window.saveAs(media._blob.content, media.name);
}
});
return m;

Loading…
Cancel
Save