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:
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
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 betterpanel/open_editor/{elementType}/{elementName}
But whileelementor.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