2018-11-16 16:33:52 +00:00
|
|
|
( function () {
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* Module containing logic for the revision pointers
|
|
|
|
*
|
2016-07-02 20:14:00 +00:00
|
|
|
* @param {string} name
|
2016-06-17 13:06:12 +00:00
|
|
|
* @constructor
|
|
|
|
*/
|
2016-07-02 20:14:00 +00:00
|
|
|
var Pointer = function ( name ) {
|
|
|
|
this.view = new mw.libs.revisionSlider.PointerView( this, name );
|
2016-11-02 18:22:40 +00:00
|
|
|
this.line = new mw.libs.revisionSlider.PointerLine( this, name );
|
2016-05-03 11:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
$.extend( Pointer.prototype, {
|
|
|
|
/**
|
2016-06-17 13:06:12 +00:00
|
|
|
* @type {number}
|
2016-05-03 11:26:42 +00:00
|
|
|
*/
|
|
|
|
position: 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {PointerView}
|
|
|
|
*/
|
|
|
|
view: null,
|
|
|
|
|
2016-11-02 18:22:40 +00:00
|
|
|
/**
|
|
|
|
* @type {PointerLine}
|
|
|
|
*/
|
|
|
|
line: null,
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @param {number} p
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
setPosition: function ( p ) {
|
|
|
|
this.position = p;
|
2017-07-11 11:41:16 +00:00
|
|
|
this.getView().setDataPositionAttribute( p );
|
2016-05-03 11:26:42 +00:00
|
|
|
},
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @return {number}
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
getPosition: function () {
|
|
|
|
return this.position;
|
|
|
|
},
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @return {PointerView}
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
getView: function () {
|
|
|
|
return this.view;
|
2016-11-02 18:22:40 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return {PointerLine}
|
|
|
|
*/
|
|
|
|
getLine: function () {
|
|
|
|
return this.line;
|
2016-05-03 11:26:42 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
|
|
mw.libs.revisionSlider.Pointer = Pointer;
|
2018-11-16 16:33:52 +00:00
|
|
|
}() );
|