function OnAfterFolderChange(data) {
if (!data.result)
return;
DOpus.Output(data.tab.path);
isInGit= DOpus.FSUtil().exists(data.tab.path+"/.git");
if(isInGit)
data.tab.vars.Set("isInGit", true);
else
data.tab.vars.Delete("isInGit");
DOpus.Output(isInGit);
}
I use this script to set the variable isInGit
. Then I add command modifier @hideif:!$tab:isInGit
in my button.
My customization works but there is a delay in reading the variable. If I navigate into a git folder, the button doesn't show. If I refresh the view, the button then appears.
I believe there is an ordering issue in OnAfterFolderChange and the evaluation of button states. How do I fix it?
Should I listen to event OnBeforeFolderChange? Can @hideif
monitor/observe variables? Can my JS script force refresh a button?
I'm using DO 12.33.