jQuery(document).ready(function(){ $dokuWiki = jQuery('.dokuwiki'); /** * If one or more edit section buttons exist? * This makes sure this feature is enabled only on the edit page and for users with page edit rights. */ if (jQuery('.editbutton_section', $dokuWiki).length > 0) { // register double click event for all headings and section divs jQuery('[class^="sectionedit"], div[class^="level"]', $dokuWiki).dblclick(function(){ // find the closest edit button form to the element double clicked (downwards) and submit the form jQuery(this).nextAll('.editbutton_section:eq(0)').children('form:eq(0)').submit(); }) } });