November 30, 2014 - Stopping the double click to edit behavior of Wagn 1.14

A feature that has been in Wagn since its earliest days is the ability to call up the card editor by double-clicking on the card's content.  While this would be a nice feature in a special-purpose editor, it is counterintuitive in a World Wide Web browsing context, where double-clicking on content selects it on word boundaries, double-click dragging and triple-click dragging selects text conveniently, and accidental double clicks away from links and form buttons have no significant consequences.

The double click event is defined in the script: slot card, which is included by default in the *all+*script rules.

To disable it in Wagn 1.14 while keeping the other script: slot functions, add this to the head section of your layout card just below the {{*head}} transclusion:

<script type="text/javascript"> $('document').ready(function() { $('body').unbind('dblclick'); $('body').dblclick(function(e){ e.stopPropagation(); e.preventDefault(); return false; }); }) </script>

After that, double-clicking will not bring up the card editor anymore, but all other JavaScript functions will still work.




2110 medium
Full list of journal entries