By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!
elementor official

JS hook panel/open_editor/{elementType} not working for anything beside 'widget'

B

BSAleLuna

New Member
Hi everybody,

I will ask here for help because I have a problem with elementor.
I added a control to the PRO widget posts as you can see in attachment. This is used in my plugin to just restrict the query to the posts in relatioship to post i'm viewing (used in template). Everything works just fine so, yeah.
The only thing that bother me is: Since query ID is used under the hood if you enable my plugin and doesnt matter if you type "asdasd" in query ID , it will always use my custom id query, I want to (display,none) the group of query id if my switch is ON.
Seems super trivial and easy, but i found a bug in elementor (i think) plus i dont know how to approach in another way.
Following the docs /js-hooks/ I was expecting to have this hook:

panel/open_editor/{elementType}​

or better

panel/open_editor/{elementType}/{elementName}​

But while
elementor.hooks.addAction('panel/open_editor/widget/posts', function (panel, model, view) {}....

Works just fine, this action is never fired for "section" nor "sections" not anything else beside elementType='widget'.
If you want proof of that just go to editor.js of elementor and go to line 24207 and add

var action = 'panel/open_editor/' + args.model.get('elType'); // Example: panel/open_editor/widget
console.log(action);
console.log(args.model.get('elType'));
elementor.hooks.doAction(action, this.component.manager, args.model, args.view); // Example: panel/open_editor/widget/heading
elType is alwasy "widget", no other action are actually fired for anything else.

The problem is when elementor fires panel/open_editor/widget/posts once you click on edit, you dont have in the the DOM all sections loaded, so you cant bind .click in my control. or even pretend you want just .css({display,none}) in the query id part always. Nope there is no dom until you open the section.

So beside the bug (i wrote to premium support to inform),How Am I suppose to interact to existing control via JS without dirty workaround ?


Thanks
 

Attachments

  • Screenshot 2021-04-26 140528.jpg
    Screenshot 2021-04-26 140528.jpg
    39.8 KB · Views: 75
  • Screenshot 2021-04-26 142634.jpg
    Screenshot 2021-04-26 142634.jpg
    60.9 KB · Views: 62

Latest posts

Latest Resources

Other Elementor Resources

elementor official
Top