summaryrefslogtreecommitdiff
path: root/resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js')
-rw-r--r--resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js b/resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
index 2ded40cf..2be29f09 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
+++ b/resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
@@ -4,9 +4,16 @@
( function ( mw, $ ) {
$( function () {
mw.util.$content.dblclick( function ( e ) {
- e.preventDefault();
- // Trigger native HTMLElement click instead of opening URL (bug 43052)
- $( '#ca-edit a' ).get( 0 ).click();
+ // Recheck preference so extensions can do a hack to disable this code.
+ if ( parseInt( mw.user.options.get( 'editondblclick' ), 10 ) ) {
+ e.preventDefault();
+ // Trigger native HTMLElement click instead of opening URL (bug 43052)
+ var $a = $( '#ca-edit a' );
+ // Not every page has an edit link (bug 57713)
+ if ( $a.length ) {
+ $a.get( 0 ).click();
+ }
+ }
} );
} );
}( mediaWiki, jQuery ) );