mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
added menu "Open file location"
This commit is contained in:
@ -115,6 +115,15 @@ Menu.prototype.disableItem = function(action, disable) {
|
||||
}
|
||||
};
|
||||
|
||||
Menu.prototype.hideItem = function(action, hide) {
|
||||
for (let item of this.items) {
|
||||
if (item.action == action) {
|
||||
$('#' + item.id).parent()
|
||||
[hide?'hide':'show']();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Menu.opened = false;
|
||||
|
||||
Menu.closeAll = function() {
|
||||
|
||||
@ -160,6 +160,7 @@ function FileModel(attributes) {
|
||||
|
||||
this.name = attributes.name || '';
|
||||
this.descr = attributes.descr || '';
|
||||
this.path = attributes.path;
|
||||
this.date = attributes.date;
|
||||
this.type = attributes.type;
|
||||
this.fileid = attributes.id;
|
||||
|
||||
@ -197,6 +197,7 @@
|
||||
|
||||
collectionRecents.events.contextmenu.attach(function(collection, model, e){
|
||||
ppmenu.actionlist = 'recent';
|
||||
ppmenu.hideItem('files:explore', false);
|
||||
ppmenu.show({left: e.clientX, top: e.clientY}, model);
|
||||
});
|
||||
|
||||
@ -221,6 +222,7 @@
|
||||
});
|
||||
collectionRecovers.events.contextmenu.attach((collection, model, e)=>{
|
||||
ppmenu.actionlist = 'recovery';
|
||||
ppmenu.hideItem('files:explore', true);
|
||||
ppmenu.show({left: e.clientX, top: e.clientY}, model);
|
||||
});
|
||||
};
|
||||
@ -231,6 +233,9 @@
|
||||
items: [{
|
||||
caption: utils.Lang.menuFileOpen,
|
||||
action: 'files:open'
|
||||
},{
|
||||
caption: 'Show in folder',
|
||||
action: 'files:explore'
|
||||
},{
|
||||
caption: utils.Lang.menuRemoveModel,
|
||||
action: 'files:forget'
|
||||
@ -259,6 +264,11 @@
|
||||
menu.actionlist == 'recent' ?
|
||||
window.sdk.LocalFileRemoveRecent(parseInt(data.fileid)) :
|
||||
window.sdk.LocalFileRemoveRecover(parseInt(data.fileid));
|
||||
} else
|
||||
if (/\:explore/.test(action)) {
|
||||
if (menu.actionlist == 'recent') {
|
||||
sdk.execCommand('files:explore', data.path);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user