2020-06-16 14:13:36 +00:00
|
|
|
/**
|
|
|
|
* @external PointerLine
|
|
|
|
* @external PointerView
|
|
|
|
*/
|
2020-11-18 09:11:12 +00:00
|
|
|
var PointerLine = require( './ext.RevisionSlider.PointerLine.js' ),
|
|
|
|
PointerView = require( './ext.RevisionSlider.PointerView.js' );
|
2020-03-29 20:54:02 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* Module containing logic for the revision pointers
|
|
|
|
*
|
|
|
|
* @class Pointer
|
|
|
|
* @param {string} name
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
function Pointer( name ) {
|
|
|
|
this.view = new PointerView( this, name );
|
|
|
|
this.line = new PointerLine( this, name );
|
|
|
|
}
|
|
|
|
|
|
|
|
$.extend( Pointer.prototype, {
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
2020-11-18 09:11:12 +00:00
|
|
|
* @type {number}
|
2016-06-17 13:06:12 +00:00
|
|
|
*/
|
2020-11-18 09:11:12 +00:00
|
|
|
position: 0,
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @type {PointerView}
|
|
|
|
*/
|
|
|
|
view: null,
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @type {PointerLine}
|
|
|
|
*/
|
|
|
|
line: null,
|
2016-11-02 18:22:40 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @param {number} p
|
|
|
|
*/
|
|
|
|
setPosition: function ( p ) {
|
|
|
|
this.position = p;
|
|
|
|
this.getView().setDataPositionAttribute( p );
|
|
|
|
},
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @return {number}
|
|
|
|
*/
|
|
|
|
getPosition: function () {
|
|
|
|
return this.position;
|
|
|
|
},
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @return {PointerView}
|
|
|
|
*/
|
|
|
|
getView: function () {
|
|
|
|
return this.view;
|
|
|
|
},
|
2016-11-02 18:22:40 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
/**
|
|
|
|
* @return {PointerLine}
|
|
|
|
*/
|
|
|
|
getLine: function () {
|
|
|
|
return this.line;
|
|
|
|
}
|
|
|
|
} );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
module.exports = {
|
|
|
|
Pointer: Pointer,
|
|
|
|
PointerLine: PointerLine,
|
|
|
|
PointerView: PointerView
|
|
|
|
};
|