Markdown Javascript mountPath into self instead of root object

I have a markdown object with a binding script that looks like this:

return """<div 
        onmousemove="
            view = [...window.__client.page.views._data.values()].find(view => view.value.mountPath == this.parentNode.parentNode.parentNode.parentNode.getAttributeNode('data-component-path').value.split('.')[0]).value;
            rect = this.getBoundingClientRect();
            
            view.params.write('fromTop', event.clientY - rect.top);
            view.params.write('fromBottom', rect.bottom - event.clientY);
            view.params.write('fromLeft', event.clientX - rect.left);
            view.params.write('fromRight', rect.right - event.clientX);
            view.params.write('width', rect.width);
            view.params.write('height', rect.height);
        "
        style="display: block; position: fixed; inset: 0;"> 
    </div>""".replace("\n", " ").replace("\t", "")

I found that view = ... line on a different project that I scavenge for this. In the designer, on the view itself, this seems to work fine, but when I try to embed the view into another, it writes to that view's view.params instead. I don't want that. I want it to only write to the view.params of the view that it is in. I don't know anything about this 'view.value.mountPath' thing, but when I try to not include the .split('.')[0] part at the end, it throws an error.

Since you're injecting Javascript, I would say you're probably largely on your own from a support aspect.

Perhaps @victordcq knows something?

I wonder if perhaps the this.parentNode.... doesn't actually get to node you think it should? Maybe it needs an additional parentNode now?

No. It seems like I actually had too many parentNodes, but I think that fixed the problem. I will have to play with it more to check.

I dont understand, could you rephrase it by naming the views parent and child, so i know which you want?

Also what are you trying to do with this? tracking the mouse movements seems rather weird to sent to ignition