TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
178 stars 54 forks source link

setting queryingDisabled after config is set #204

Closed eric-personal closed 1 year ago

eric-personal commented 1 year ago

Is there a way to set queryingDisabled after Yasgui instantiation. I'm looking for a way to disable submit of query while the query response is waiting to be returned. I tried to reset the queryingDisabled property example:

yasgui.config.yasqe.queryingDisabled = true;

The only way the above line seems to work is durning Yasgui instantiation.

I know I can set pointer-events: none; on the container element but anyone can turn this back on via dev tools. I'm trying to prevent multiple calls to the submit query until the first submit was successful.

thanks!

GerwinBosch commented 1 year ago

Hello @eric-personal,

One possible way of doing this is using Yasqe's event system:

yasgui.on("query", (_yasgui,tab) => tab.yasqe.config.queryingDisabled=true);
yasgui.on("queryResponse", (_yasgui,tab) => {
  tab.yasqe.config.queryingDisabled=false;
  tab.yasqe.drawButtons();
});
GerwinBosch commented 1 year ago

I am closing this issue as I interpret the emoji's to mean that the issue is resolved

eric-personal commented 1 year ago

Yes thank you your solution was perfect.