mediawiki.jqueryMsg: Prevent default action for functions as external link
authorFomafix <fomafix@googlemail.com>
Mon, 16 Jun 2014 18:10:37 +0000 (18:10 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Mon, 16 Jun 2014 18:10:37 +0000 (18:10 +0000)
Change-Id: I811b165b1dd20b42ffb5a933a081a622b8cd2a49

resources/src/mediawiki/mediawiki.jqueryMsg.js

index 9d34d62..3f778d8 100644 (file)
                        } else {
                                $el = $( '<a>' );
                                if ( typeof arg === 'function' ) {
-                                       $el.click( arg ).attr( 'href', '#' );
+                                       $el.attr( 'href', '#' )
+                                       .click( function ( e ) {
+                                               e.preventDefault();
+                                       } )
+                                       .click( arg );
                                } else {
                                        $el.attr( 'href', arg.toString() );
                                }