jenkins-bot has submitted this change and it was merged.

Change subject: Remove JS adding/removing 'hover' CSS class, use :hover 
pseudoclass instead
......................................................................


Remove JS adding/removing 'hover' CSS class,
use :hover pseudoclass instead

Bug: T120627
Change-Id: I47624f944b4a67db82c957a242f6f98e7904957a
---
M resources/jquery/jquery.showThumbCtrl.css
M resources/jquery/jquery.showThumbCtrl.js
M resources/mw.UploadWizardUploadInterface.js
M resources/uploadWizard.css
4 files changed, 5 insertions(+), 36 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/jquery/jquery.showThumbCtrl.css 
b/resources/jquery/jquery.showThumbCtrl.css
index abd9810..29f0e1a 100644
--- a/resources/jquery/jquery.showThumbCtrl.css
+++ b/resources/jquery/jquery.showThumbCtrl.css
@@ -3,7 +3,7 @@
        cursor: pointer;
 }
 
-.mwe-upwiz-show-thumb-ctrl.hover .mwe-upwiz-show-thumb-ctrl-msg {
+.mwe-upwiz-show-thumb-ctrl:hover .mwe-upwiz-show-thumb-ctrl-msg {
        text-decoration: underline;
 }
 
diff --git a/resources/jquery/jquery.showThumbCtrl.js 
b/resources/jquery/jquery.showThumbCtrl.js
index de23b2f..bb4a9ca 100644
--- a/resources/jquery/jquery.showThumbCtrl.js
+++ b/resources/jquery/jquery.showThumbCtrl.js
@@ -8,16 +8,9 @@
                        .attr( 'title', mw.message( tooltipMsgKey ).escaped() )
                        .click( function () {
                                $( this )
-                                       .removeClass( 'hover' )
                                        .addClass( 'disabled' )
                                        .unbind( 'mouseenter mouseover 
mouseleave mouseout mouseup mousedown' );
                                callback();
-                       } )
-                       .hover( function () {
-                               $( this ).addClass( 'hover' );
-                       },
-                       function () {
-                               $( this ).removeClass( 'hover' );
                        } )
                        .append( $( '<div class="ui-icon ui-icon-image" /><div 
class="mwe-upwiz-show-thumb-ctrl-msg">' + msg + '</div>' ) );
        };
diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index 78cec76..322474c 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -1,5 +1,4 @@
-( function ( mw, uw, $, OO ) {
-
+       ( function ( mw, uw, $, OO ) {
        /**
         * Create an interface fragment corresponding to a file input, suitable 
for Upload Wizard.
         *
@@ -560,7 +559,6 @@
         */
        mw.UploadWizardUploadInterface.prototype.updateFilename = function () {
                var $div,
-                       ui = this,
                        path = this.getFilename();
                // get basename of file; some browsers do this 
C:\fakepath\something
                path = path.replace( /\w:.*\\(.*)$/, '$1' );
@@ -588,28 +586,6 @@
                        this.moveFileInputToCover(
                                $div.find( 
'.mwe-upwiz-visible-file-filename-text' )
                        );
-
-                       // Highlight the file on mouseover (and also show 
controls like the remove control).
-                       //
-                       // On Firefox there are bugs related to capturing mouse 
events on inputs, so we seem to miss the
-                       // mouseenter or mouseleave events randomly. It's only 
really bad if we miss mouseleave,
-                       // and have two highlights visible. so we add another 
call to REALLY make sure that other highlights
-                       // are deactivated.
-                       // http://code.google.com/p/fbug/issues/detail?id=2075
-                       //
-                       // ALSO: When file inputs are adjacent, Firefox misses 
the "mouseenter" and "mouseleave" events.
-                       // Consequently we have to bind to "mouseover" and 
"mouseout" as well even though that's not as efficient.
-                       $div.bind( 'mouseenter mouseover', function () {
-                               $div.addClass( 'hover' );
-                               $( '#mwe-upwiz-filelist' )
-                                       .children()
-                                       .filter( function () { return this !== 
ui.div; } )
-                                       .removeClass( 'hover' );
-                       } );
-                       $div.bind( 'mouseleave mouseout', function () {
-                               $div.removeClass( 'hover' );
-                       } );
-
                        this.emit( 'upload-filled' );
                } else {
                        this.emit( 'filename-accepted' );
diff --git a/resources/uploadWizard.css b/resources/uploadWizard.css
index 13f7353..12201ff 100644
--- a/resources/uploadWizard.css
+++ b/resources/uploadWizard.css
@@ -65,7 +65,7 @@
 }
 
 /* NOT a pseudoclass */
-#mwe-upwiz-add-file.hover {
+#mwe-upwiz-add-file:hover {
        text-decoration: underline;
 }
 
@@ -257,7 +257,7 @@
        overflow: hidden;
 }
 
-.mwe-upwiz-file.hover .mwe-upwiz-visible-file {
+.mwe-upwiz-file:hover .mwe-upwiz-visible-file {
        background: #e0f0ff !important;
 }
 
@@ -298,7 +298,7 @@
        background: url('images/24px-spinner-0645ad-f5f5f5.gif') no-repeat 
center center;
 }
 
-.mwe-upwiz-file.hover .mwe-upwiz-status-progress {
+.mwe-upwiz-file:hover .mwe-upwiz-status-progress {
        /* @embed */
        background: url('images/24px-spinner-0645ad-e0f0ff.gif') no-repeat 
center center;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/260327
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I47624f944b4a67db82c957a242f6f98e7904957a
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Ananay <[email protected]>
Gerrit-Reviewer: Aklapper <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to