mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 11:40:43 +00:00
54720944a0
This creates a module for the draggable pointers for the RevisionSlider mainly to encapsulate both the pointers' state and their HTML code. Some animation methods such as slideToSide and slideToPosition that are still flying around in init.js weren't added to the module since I thought they should be part of the not yet existing Slider module. Change-Id: I1292bfb0bbd68f8d2de04b3b5e5f3133ec6363b8
19 lines
479 B
JavaScript
19 lines
479 B
JavaScript
( function ( mw ) {
|
|
var Pointer = mw.libs.revisionSlider.Pointer;
|
|
|
|
QUnit.module( 'ext.RevisionSlider.Revision' );
|
|
|
|
QUnit.test( 'Initialize Pointer', function ( assert ) {
|
|
assert.ok( ( new Pointer( 'left-pointer' ) ).getView().render().find( '.left-pointer' ) );
|
|
} );
|
|
|
|
QUnit.test( 'Set and get position', function ( assert ) {
|
|
var pointer = new Pointer(),
|
|
pos = 42;
|
|
|
|
pointer.setPosition( pos );
|
|
assert.equal( pointer.getPosition(), pos );
|
|
} );
|
|
|
|
} )( mediaWiki );
|