mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
50 lines
814 B
JavaScript
50 lines
814 B
JavaScript
|
( function ( mw, $ ) {
|
||
|
var PointerView = function ( cssClass, offset ) {
|
||
|
this.cssClass = cssClass;
|
||
|
this.offset = offset;
|
||
|
};
|
||
|
|
||
|
$.extend( PointerView.prototype, {
|
||
|
/**
|
||
|
* @type {string}
|
||
|
*/
|
||
|
cssClass: '',
|
||
|
|
||
|
/**
|
||
|
* @type {int}
|
||
|
*/
|
||
|
offset: 0,
|
||
|
|
||
|
/**
|
||
|
* @type {jQuery}
|
||
|
*/
|
||
|
$html: null,
|
||
|
|
||
|
initialize: function () {
|
||
|
this.$html = $( '<div class="pointer" />' ).addClass( this.cssClass );
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* @return {jQuery}
|
||
|
*/
|
||
|
render: function () {
|
||
|
this.initialize();
|
||
|
return this.getElement();
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* @return {jQuery}
|
||
|
*/
|
||
|
getElement: function () {
|
||
|
return this.$html;
|
||
|
},
|
||
|
|
||
|
getOffset: function () {
|
||
|
return this.offset;
|
||
|
}
|
||
|
} );
|
||
|
|
||
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
||
|
mw.libs.revisionSlider.PointerView = PointerView;
|
||
|
}( mediaWiki, jQuery ) );
|