Commit 007027cc authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

FileManager: improved handling of opening a folder

parent b375c5a1
......@@ -33,37 +33,20 @@ define([
// register new file handler
FileHandler2.addExt("open", {
// intercept run if we can handle it "in-house"
// intercept run if we can handle it "in-house" on a "plain" open
run: function run(info) {
if (info._f2br)
if (info._f2br && info.viaBestOpen)
info._f2br.$emit("nav", this.fullPath(info));
else
return run._super.call(this, info);
},
}, "fileManager", {
label: "Browse folder",
label: "File Manager",
iconClass: "fa-folder-open",
position: 1,
}, function(path) {
return ["file2", "FileMainView", {path: path}];
return ["file2", "FileMain", {path: path}];
}, false);
// alternative "in-house" folder handling
FileHandler2.addExt("single", {
menuTmpl: {
label: "Open in new tab",
iconClass: "fa-folder-open",
position: 3,
},
check: function check(info) {
return check._super.call(this, info) && info.data.type == "d" && info._f2br;
},
run: function (info) {
info.view.spawnInstance("file2", "FileMainView", {
path: this.fullPath(info),
});
},
}, "openInNewTab");
return File2Extension;
});
......@@ -25,6 +25,7 @@ define([
},
run: function (info) {
var bo = FileHandler2._bestOpen(info);
info.viaBestOpen = true;
return bo ? bo.callback() : false;
},
}, "open");
......
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