Commit 625e05eb authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

FileManager: added keyboard-shortcuts

parent f9e93730
......@@ -2,6 +2,10 @@ define([
], function(
) {
var metaCtrl = function (key) {
return "mac:meta+"+key+" ctrl+"+key;
};
var preferences = {
label: "File Manager",
iconClass: "fa-folder-o",
......@@ -56,7 +60,83 @@ define([
level: 5,
global: true,
},
}
// keys
keyCopy: {
label: "Copy",
type: "shortcut",
level: 2,
value: metaCtrl("c"),
callback: function() {
this.action("copy");
}
},
keyCut: {
label: "Cut",
type: "shortcut",
level: 2,
value: metaCtrl("x"),
callback: function() {
this.action("cut");
}
},
keyPaste: {
label: "Paste",
type: "shortcut",
level: 2,
value: metaCtrl("v"),
callback: function() {
this.action("paste");
}
},
keyDelete: {
label: "Delete",
type: "shortcut",
level: 2,
value: "mac:meta+backspace del",
callback: function() {
this.action("remove");
}
},
// these need "focus": rename, open
keyParent: {
label: "Navigate into parent folder",
type: "shortcut",
level: 2,
value: "mac:meta+up backspace",
callback: function() {
this.goUp();
}
},
keyReload: {
label: "Reload the content of the current folder",
type: "shortcut",
level: 2,
value: "mac:meta+r F5",
callback: function() {
this.reload();
}
},
keyInfo: {
label: "Open info dialog of context menu",
type: "shortcut",
level: 2,
value: metaCtrl("i"),
callback: function() {
this.action("info");
}
},
// selection: all & none
keyFilter: {
label: "Filter files in current view",
type: "shortcut",
level: 2,
value: metaCtrl("f"),
callback: function() {
this.vue.content.filterStart();
event.stopPropagation();
},
},
},
};
return preferences;
......
......@@ -57,6 +57,10 @@ define([
watch_id: "0",
});
},
action: function (what) {
this.vue.content.$emit("action", what, {});
}
};
return BaseMixin;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment