postEdit: Simplify close button
authorFomafix <fomafix@googlemail.com>
Sun, 27 Aug 2017 16:45:25 +0000 (18:45 +0200)
committerFomafix <fomafix@googlemail.com>
Sun, 27 Aug 2017 17:22:05 +0000 (19:22 +0200)
Use <span> instead of <a href="#"> for the close button. This makes
resetting the CSS style and the preventDefault() superfluous and
prevents open a new tab on middle click and does not show an
unnecessary status bar on hover.

Change-Id: I8c60aae454d64803686088f1dbe0228b1ecc70be

resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
resources/src/mediawiki.action/mediawiki.action.view.postEdit.less

index e25c96a..09eef57 100644 (file)
@@ -50,9 +50,8 @@
 
                $popup = $( '<div>' ).addClass( 'postedit mw-notification' ).append(
                        $content,
-                       $( '<a>' ).addClass( 'postedit-close' ).attr( 'href', '#' ).text( '×' )
-               ).on( 'click', function ( e ) {
-                       e.preventDefault();
+                       $( '<span>' ).addClass( 'postedit-close' ).text( '×' )
+               ).click( function () {
                        clearTimeout( timeoutId );
                        fadeOutConfirmation();
                } );
index 8094559..633fd20 100644 (file)
        font-size: 1.25em;
        font-weight: bold;
        line-height: 2.3em;
-       color: #000;
        text-shadow: 0 0.0625em 0 #fff;
-       text-decoration: none;
        opacity: 0.2;
 
        .postedit:hover & {
-               color: #000;
-               text-decoration: none;
                opacity: 0.4;
        }
 }