Hi there! o)
I noticed a little weirdness while enhancing my tiny folder format overrider, which evaulates the number of folders and then makes use of "Go .. NOSCRIPT" to set viewmode or format "manually", cancelling the OnBeforeFolderChange() event at the same time.
If there's a dual lister opened and "Go BACK" is run, and you run "Go BACK NOSCRIPT" within OnBeforeFolderChange() to emulate regular behaviour, the destination lister is changed, instead of the source. Using SetSourceTab() does not make a difference. And it seems, you need a hotkey to run "Go BACK" and make the event fire. Using the GO command in the commandline of a lister or within a script command to trigger the event, works as expected.
If you run "Go UP NOSCRIPT" in the event, it makes the source change as expected, so there seems to be something wrong with the BACK switch in this special situation. Thanks! o)
///////////////////////////////////////////////////////////////////////////////
function OnInit(data){
data.name = "Command.Folder: GoBackUpTest";
data.default_enable = true;
}
///////////////////////////////////////////////////////////////////////////////
var FOLDERCHANGE_PROCEED=false;
var FOLDERCHANGE_CANCEL=true;
///////////////////////////////////////////////////////////////////////////////
function OnBeforeFolderChange(data){
var cmd = DOpus.NewCommand();
cmd.SetSourceTab(data.tab);
switch (data.action){
case 'parent':
DOpus.Output("Cancelling event, manually 'Going UP'..");
cmd.RunCommand('Go UP NOSCRIPT');
return FOLDERCHANGE_CANCEL;
break;
case 'back':
DOpus.Output("Cancelling event, manually 'Going BACK'..");
cmd.RunCommand('Go BACK NOSCRIPT');
return FOLDERCHANGE_CANCEL;
break;
default:
DOpus.Output("Event not cancelled, doing nothing.");
return FOLDERCHANGE_PROCEED;
break;
}
}