mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
Merge "Remove redundant checks for .length on jQuery objects"
This commit is contained in:
commit
07982bcc54
|
@ -240,17 +240,10 @@
|
||||||
* Hides the current tooltip immediately
|
* Hides the current tooltip immediately
|
||||||
*/
|
*/
|
||||||
hideCurrentTooltip: function () {
|
hideCurrentTooltip: function () {
|
||||||
var $highlightedRevisionWrapper = $( '.mw-revslider-revision-wrapper-hovered' ),
|
window.clearTimeout( this.tooltipTimeout );
|
||||||
$currentTooltip = $( '.mw-revslider-revision-tooltip' );
|
$( '.mw-revslider-revision-wrapper-hovered' )
|
||||||
if ( this.tooltipTimeout !== -1 ) {
|
.removeClass( 'mw-revslider-revision-wrapper-hovered' );
|
||||||
window.clearTimeout( this.tooltipTimeout );
|
$( '.mw-revslider-revision-tooltip' ).remove();
|
||||||
}
|
|
||||||
if ( $highlightedRevisionWrapper.length !== 0 ) {
|
|
||||||
$highlightedRevisionWrapper.removeClass( 'mw-revslider-revision-wrapper-hovered' );
|
|
||||||
}
|
|
||||||
if ( $currentTooltip.length !== 0 ) {
|
|
||||||
$currentTooltip.remove();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -259,14 +252,9 @@
|
||||||
* @param {jQuery} $revisionWrapper
|
* @param {jQuery} $revisionWrapper
|
||||||
*/
|
*/
|
||||||
hideTooltip: function ( $revisionWrapper ) {
|
hideTooltip: function ( $revisionWrapper ) {
|
||||||
var $currentTooltip = $( '.mw-revslider-revision-tooltip' );
|
|
||||||
this.tooltipTimeout = window.setTimeout( function () {
|
this.tooltipTimeout = window.setTimeout( function () {
|
||||||
if ( $revisionWrapper.length !== 0 ) {
|
$revisionWrapper.removeClass( 'mw-revslider-revision-wrapper-hovered' );
|
||||||
$revisionWrapper.removeClass( 'mw-revslider-revision-wrapper-hovered' );
|
$( '.mw-revslider-revision-tooltip' ).remove();
|
||||||
}
|
|
||||||
if ( $currentTooltip.length !== 0 ) {
|
|
||||||
$currentTooltip.remove();
|
|
||||||
}
|
|
||||||
}, 500 );
|
}, 500 );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue