mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
Merge remaining pointer methods
Change-Id: I89562e445481b9785cf18e02ea02040105632af7
This commit is contained in:
parent
c6f24f2100
commit
05925e3ab0
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 () {
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue