mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 11:40:43 +00:00
980f2ca917
* threw out most of the things from init.js * turned Slider + View into respective modules * pointers should remember position (except on page load) and correctly slide back to their position/to the side Some things still need testing and refactoring. Addshore: - CS fixes and comment out current failing tests Bug: T134395 Change-Id: I78a7095e1d9902314163b1443448f47ef0484d4e
33 lines
586 B
JavaScript
33 lines
586 B
JavaScript
( function ( mw, $ ) {
|
|
var Pointer = function ( cssClass, offset ) {
|
|
this.view = new mw.libs.revisionSlider.PointerView( this, cssClass, offset );
|
|
};
|
|
|
|
$.extend( Pointer.prototype, {
|
|
/**
|
|
* @type {int}
|
|
*/
|
|
position: 0,
|
|
|
|
/**
|
|
* @type {PointerView}
|
|
*/
|
|
view: null,
|
|
|
|
setPosition: function ( p ) {
|
|
this.position = p;
|
|
},
|
|
|
|
getPosition: function () {
|
|
return this.position;
|
|
},
|
|
|
|
getView: function () {
|
|
return this.view;
|
|
}
|
|
} );
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
mw.libs.revisionSlider.Pointer = Pointer;
|
|
}( mediaWiki, jQuery ) );
|