Merge remaining pointer methods

Change-Id: I89562e445481b9785cf18e02ea02040105632af7
This commit is contained in:
WMDE-Fisch 2017-07-04 12:20:50 +02:00
parent c6f24f2100
commit 05925e3ab0
2 changed files with 14 additions and 45 deletions

View file

@ -410,13 +410,23 @@
},
setPointerDragCursor: function () {
$( '.mw-revslider-revision-wrapper' )
.addClass( 'mw-revslider-pointer-cursor' );
$( '.mw-revslider-pointer, ' +
'.mw-revslider-pointer-container, ' +
'.mw-revslider-pointer-container-newer, ' +
'.mw-revslider-pointer-container-older, ' +
'.mw-revslider-pointer-line, ' +
'.mw-revslider-revision-wrapper' )
.addClass( 'mw-revslider-pointer-grabbing' );
},
removePointerDragCursor: function () {
$( '.mw-revslider-revision-wrapper' )
.removeClass( 'mw-revslider-pointer-cursor' );
$( '.mw-revslider-pointer, ' +
'.mw-revslider-pointer-container, ' +
'.mw-revslider-pointer-container-newer, ' +
'.mw-revslider-pointer-container-older, ' +
'.mw-revslider-pointer-line, ' +
'.mw-revslider-revision-wrapper' )
.removeClass( 'mw-revslider-pointer-grabbing' );
},
/**
@ -471,7 +481,6 @@
);
}
view.resetPointerColorsBasedOnValues( view.pointerOlder.getPosition(), view.pointerNewer.getPosition() );
view.resetRevisionStylesBasedOnPointerPosition( $revisions );
view.alignPointers();
},
@ -583,23 +592,6 @@
this.updatePointerPositionAttributes();
},
/**
* Adjusts the colors of the pointers without changing the upper/lower property based on values `p1` and `p2`.
* Used e.g. when pointers get dragged past one another.
*
* @param {number} p1
* @param {number} p2
*/
resetPointerColorsBasedOnValues: function ( p1, p2 ) {
if ( p1 > p2 ) {
this.pointerOlder.getView().getElement().removeClass( 'mw-revslider-pointer-oldid' ).addClass( 'mw-revslider-pointer-newid' );
this.pointerNewer.getView().getElement().removeClass( 'mw-revslider-pointer-newid' ).addClass( 'mw-revslider-pointer-oldid' );
} else {
this.pointerOlder.getView().getElement().removeClass( 'mw-revslider-pointer-newid' ).addClass( 'mw-revslider-pointer-oldid' );
this.pointerNewer.getView().getElement().removeClass( 'mw-revslider-pointer-oldid' ).addClass( 'mw-revslider-pointer-newid' );
}
},
/**
* Resets the slider lines based on the selected revisions
*/

View file

@ -14,29 +14,6 @@
$.extend( SliderViewTwo.prototype, {
setPointerDragCursor: function () {
$( '.mw-revslider-pointer, ' +
'.mw-revslider-pointer-container, ' +
'.mw-revslider-pointer-container-newer, ' +
'.mw-revslider-pointer-container-older, ' +
'.mw-revslider-pointer-line, ' +
'.mw-revslider-revision-wrapper' )
.addClass( 'mw-revslider-pointer-grabbing' );
},
removePointerDragCursor: function () {
$( '.mw-revslider-pointer, ' +
'.mw-revslider-pointer-container, ' +
'.mw-revslider-pointer-container-newer, ' +
'.mw-revslider-pointer-container-older, ' +
'.mw-revslider-pointer-line, ' +
'.mw-revslider-revision-wrapper' )
.removeClass( 'mw-revslider-pointer-grabbing' );
},
resetPointerColorsBasedOnValues: function () {
},
revisionWrapperClickHandler: function () {
}
} );