Support for handler for double-click prevention via CSS class
This change makes it possible to provide a double click prevention for HTML e…
Show more
Support for handler for double-click prevention via CSS classThis change makes it possible to provide a double click prevention forHTML elements via the CSS class "prevent-double-click". The doubleclick prevention deactivates a button or an anchor element afterclicking for a short time (per default for 1s) and ignores in thistime window further clicks. The time window can be specified via thedata element oacs-timeout. When a double click occurs, the duplicateclick is determined at the client side (in the browser) such that thefirst request will continue to run and will render its result whenfinished. Without double-click prevention (or with thedouble-click-prevention on the server side), the results of the firstrequest are lost for the client, although these are still computed atthe server side.Usage Example: <p>text with a <a class="prevent-double-click" data-oacs-timeout="2000" href="/slow.tcl?t=10s">link</a> <p> <form action="/slow.tcl"> <input class="btn prevent-double-click" data-oacs-timeout="2000" type="submit" value="Submit"> ... </form>By reactivating the button automatically after the timeout, thisapproach works also reasonable well when opening additional tabs orbrowser windows.The handler and implementation are designed to work with streamingHTML, provided that "template::collect_body_scripts" is called (likethe reset of the template::* styling interface).When HTML elements are deactivated, the DOM property "disabled" is setas well as a CSS class "disabled". Since disabled anchors arevisually not different from non-disabled anchors, this CSS class canbe used for styling disabled anchors differently.
Show less