It's better when it's simple

User Tools

Site Tools


Use jQuery to Enable Double-clicking to Edit

This snippet is broken. Refer to Double Click to Open a Section Edit (improved) version for a working solution.

Many WIKI's and CMS's have the ability to double-click an article to go straight to edit mode. DokuWiki doesn't have this as standard.

the following JavaScript:

  /* Double-Click the contetnt area to go to edit */
  jQuery('#bodyContent').dblclick(function(event) {
    // console.log('calling doubleclick on tag='+this.tagName+', class='+this.className);
    if ( != 'TEXTAREA') {
       window.location = '?do=edit';

This binds a doubleclick event to DIV#bodyContent. As long as the event does not occur in the edit textarea (which would mean that we are already in edit mode), this redirects the browser to the edit mode for the page.

Julian Knight 2012-03-27

tips/doubleclickedit.txt · Last modified: 2017-05-30 09:05 by

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki