From ccd811b4dc320196c06313cacdea14b732d650cc Mon Sep 17 00:00:00 2001 From: abose Date: Fri, 12 Jan 2024 11:55:35 +0530 Subject: [PATCH] feat: click binoculor icon/locate in file tree for non project files opens file in explorer --- src/project/ProjectModel.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/project/ProjectModel.js b/src/project/ProjectModel.js index a5abb5a80..0e11db251 100644 --- a/src/project/ProjectModel.js +++ b/src/project/ProjectModel.js @@ -685,12 +685,14 @@ define(function (require, exports, module) { path = _getPathFromFSObject(path); if (!this.isWithinProject(path)) { - return d.resolve().promise(); + Phoenix.app.openPathInFileBrowser(path) + .then(d.resolve) + .catch(d.reject); + return d.promise(); } - var parentDirectory = FileUtils.getDirectoryPath(path), - self = this; - this.setDirectoryOpen(parentDirectory, true).then(function () { + const self = this; + this.setDirectoryOpen(FileUtils.getDirectoryPath(path), true).then(function () { if (_pathIsFile(path)) { self.setSelected(path); }