[ui] AttributeEditor: add contextual actions on File params

* add 'Open Containing Folder'/'Open File' actions for filepaths
* add 'Open Folder' action for folders
* misc: tweak spacings
This commit is contained in:
Yann Lanthony 2018-02-05 19:03:27 +01:00
parent c45ebdf83c
commit 60f1f36ff8
3 changed files with 33 additions and 2 deletions

View file

@ -15,3 +15,10 @@ function extension(path) {
var dot_pos = path.lastIndexOf('.');
return dot_pos > -1 ? path.substring(dot_pos, path.length) : ""
}
/// Return whether the given path is a path to a file.
/// (only based on the fact that the last portion of the path
/// matches the 'basename.extension' pattern)
function isFile(path) {
return extension(path) !== ""
}