mediawiki-extensions-Revisi.../modules/ext.RevisionSlider.Pointer.js
WMDE-Fisch df9d94ca60 Draw lines between pointers and related columns
Introducing a new class that draws lines between the pointers
and the related diff columns. Lines are redrawn when pointers
were moved. A colored border is added to the diff columns and
readded when the diff changes.

Bug: T149175
Change-Id: Iadf779368c58da7779c769bda8e9bd3fc5afcffa
2016-11-08 13:46:14 +01:00

61 lines
994 B
JavaScript

( function ( mw, $ ) {
/**
* Module containing logic for the revision pointers
*
* @param {string} name
* @constructor
*/
var Pointer = function ( name ) {
this.view = new mw.libs.revisionSlider.PointerView( this, name );
this.line = new mw.libs.revisionSlider.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;
},
/**
* @return {number}
*/
getPosition: function () {
return this.position;
},
/**
* @return {PointerView}
*/
getView: function () {
return this.view;
},
/**
* @return {PointerLine}
*/
getLine: function () {
return this.line;
}
} );
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
mw.libs.revisionSlider.Pointer = Pointer;
}( mediaWiki, jQuery ) );