As I mostly use a pretty minimal lister window which sits in a corner of my laptop screen (only consuming approx. 1/4 th of my screen space), I’m often using a button to open an external minimal listener (without directory tree etc.) just to have a quick, broader view on a folder. The button has the following statements:
@ifsel:dirs
GO FROMSEL NEW=100,10,1600,600,notree,nodual,noviewpane,noutilitypanel,nometapane LAYOUT=Single VIEW=Details NOSCRIPT
@ifsel:else
GO CURRENT NEW=100,10,1600,600,notree,nodual,noviewpane,noutilitypanel,nometapane LAYOUT=Single VIEW=Details NOSCRIPT
This is two times almost the same command. The first condition is invoked when I selected a folder - in which case it shows me the content of that folder - hence the “FROMSEL” directive. This works perfectly. This is perfect.
If no folder is selected, the “ifsel:else” condition applies, which should show in big format the contents of the folder that I already have open (hence “CURRENT” instead of “FROMSEL” - the only difference).
Problem is: when nothing is selected, the second statement is not being executed. It only works if I select at least 1 file. That doesn’t seem correct to me. And “ifsel:common” is not the solution either - it opens 2 windows when I have a folder selected - which is to be expected).
Could this be a little bug in the implementation?
For the moment, I changed this to work with javascript scripting - which allowed me to correctly detect the selection of a folder and implement a correct if/else condition:
function OnClick(clickData)
{
var srcTab = clickData.func.sourcetab;
var cmd = clickData.func.command;
var selected = clickData.func.sourcetab.selected_dirs;
var itemcount = selected.count;
if (itemcount > 0) {
cmd.RunCommand("GO FROMSEL NEW=100,10,1600,600,notree,nodual,noviewpane,noutilitypanel,nometapane LAYOUT=Single VIEW=Details NOSCRIPT");
} else {
cmd.RunCommand("GO CURRENT NEW=100,10,1600,600,notree,nodual,noviewpane,noutilitypanel,nometapane LAYOUT=Single VIEW=Details NOSCRIPT");
}
}
So it isn’t anymore an issue for me. Still, it looks to me like the “ifsel:else” implementation shows inconsistent behaviour.