Triply-Dev / YASGUI.YASQE-deprecated

Deprecated, see https://github.com/TriplyDB/Yasgui for the Yasgui monorepo
MIT License
73 stars 36 forks source link

Jump to result section when a query has finished #53

Closed jneubert closed 9 years ago

jneubert commented 9 years ago

Related to #52 - is it possible to jump to the yasr results, when a yasqe query has finished execution?

LaurensRietveld commented 9 years ago

This is something more appropriate for the http://github.com/YASGUI/YASGUI library To implement this yourself to the combination of YASQE and YASR, I suggest you use the scrollIntoView DOM function: go to the complete callback function of YASQE (the same function where you set the YASR results), and add something like document.getElementById('<dom-id-of-yasr').scrollIntoView()

jneubert commented 9 years ago

Yes, that works fine. Since I had to fiddle with the syntax, her my code:

yasqe.options.sparql.callbacks.complete = function() {
  document.getElementById('yasr').scrollIntoView()
  window.yasr.setResponse.apply(this, arguments);
}

Thanks!