TriplyDB / Yasgui

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

setting queryingDisabled after config is set #204

Closed eric-personal closed 2 years ago

eric-personal commented 2 years 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 2 years 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 2 years ago

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

eric-personal commented 2 years ago

Yes thank you your solution was perfect.