Compare commits

...

2 Commits

Author SHA1 Message Date
DrMaxNix c3136aad4a 📄 update copyright year 2024-03-08 22:49:36 +01:00
DrMaxNix 6512d5e89b 🐛 use default in case tree-view setting is unset 2024-03-08 22:49:30 +01:00
4 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 DrMaxNix
Copyright (c) 2024 DrMaxNix
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -52,7 +52,9 @@ tryTreeViewClose = function(){
var treeViewHasProjects = (treeView.element.querySelector("ol.tree-view-root") != null);
// close the tree-view dock when the `Hidden On Startup` setting is activated or when it is empty
if(atom.packages.config.settings["tree-view"].hiddenOnStartup || !treeViewHasProjects){
let treeViewSettings = atom.packages.config.settings["tree-view"] ?? {};
let hiddenOnStartup = treeViewSettings.hiddenOnStartup ?? false;
if(hiddenOnStartup || !treeViewHasProjects){
treeView.hide();
}
@ -82,7 +84,6 @@ atom.workspace.onDidOpen ({item}) ->
tryTreeViewCloseInterval = setInterval(tryTreeViewClose, 100)
## TRY TO CLOSE THE TREE-VIEW ##
tryTreeViewClose = () ->
# get tree-view element
@ -101,7 +102,9 @@ tryTreeViewClose = () ->
treeViewHasProjects = (treeView.element.querySelector("ol.tree-view-root") != null)
# close the tree-view dock when the `Hidden On Startup` setting is activated or when it is empty
if atom.packages.config.settings["tree-view"].hiddenOnStartup || !treeViewHasProjects
treeViewSettings = atom.packages.config.settings["tree-view"] ? {}
hiddenOnStartup = treeViewSettings.hiddenOnStartup ? false
if hiddenOnStartup || !treeViewHasProjects
treeView.hide()
# stop trying
@ -116,4 +119,4 @@ Now you can configure whether you want the tree-view to be hidden on startup in
**Hidden On Startup: not checked**: Only hide tree-view on startup when it does not contain open projects
> Successfully tested using Pulsar v1.104.0
> Successfully tested using Pulsar v1.114.0

View File

@ -35,7 +35,9 @@ tryTreeViewClose = () ->
treeViewHasProjects = (treeView.element.querySelector("ol.tree-view-root") != null)
# close the tree-view dock when the `Hidden On Startup` setting is activated or when it is empty
if atom.packages.config.settings["tree-view"].hiddenOnStartup || !treeViewHasProjects
treeViewSettings = atom.packages.config.settings["tree-view"] ? {}
hiddenOnStartup = treeViewSettings.hiddenOnStartup ? false
if hiddenOnStartup || !treeViewHasProjects
treeView.hide()
# stop trying

View File

@ -37,7 +37,9 @@ tryTreeViewClose = function(){
var treeViewHasProjects = (treeView.element.querySelector("ol.tree-view-root") != null);
// close the tree-view dock when the `Hidden On Startup` setting is activated or when it is empty
if(atom.packages.config.settings["tree-view"].hiddenOnStartup || !treeViewHasProjects){
let treeViewSettings = atom.packages.config.settings["tree-view"] ?? {};
let hiddenOnStartup = treeViewSettings.hiddenOnStartup ?? false;
if(hiddenOnStartup || !treeViewHasProjects){
treeView.hide();
}