mediawiki-extensions-Revisi.../modules/ext.RevisionSlider.Pointer.js
Jakob Warkotsch 980f2ca917 Create Slider module.
* 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
2016-05-10 17:38:46 +01:00

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 ) );