mediawiki-extensions-Revisi.../modules/ext.RevisionSlider.Pointer.js
Thiemo Kreuz 4ac1ff57f1 Remove closure wrappers from all JavaScript code
These are not needed any more, because the code runs in a
seperate scope anyway.

Change-Id: I939a06102f194a0c98021accb2f62be73dd0562f
2020-11-18 11:16:04 +01:00

71 lines
1.1 KiB
JavaScript

/**
* @external PointerLine
* @external PointerView
*/
var PointerLine = require( './ext.RevisionSlider.PointerLine.js' ),
PointerView = require( './ext.RevisionSlider.PointerView.js' );
/**
* 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, {
/**
* @type {number}
*/
position: 0,
/**
* @type {PointerView}
*/
view: null,
/**
* @type {PointerLine}
*/
line: null,
/**
* @param {number} p
*/
setPosition: function ( p ) {
this.position = p;
this.getView().setDataPositionAttribute( p );
},
/**
* @return {number}
*/
getPosition: function () {
return this.position;
},
/**
* @return {PointerView}
*/
getView: function () {
return this.view;
},
/**
* @return {PointerLine}
*/
getLine: function () {
return this.line;
}
} );
module.exports = {
Pointer: Pointer,
PointerLine: PointerLine,
PointerView: PointerView
};