If you want help with your code, you need to share what you’ve written. But I can tell by the line numbers you mentioned that you’re way overthinking it. Look at this:
That says, “When the panel is generated, check
tree-view.showOnRightSide. If it exists, then put the panel on the right side. Otherwise, put the panel on the left side.” The solution is not language-specific. All you need to do is eliminate the conditional.
Now it knows exactly which function to use because there is no question. You should also undo the other changes, in case you introduced anything that messes up how it works.