Skip to content

Commit 69fd538

Browse files
committed
Added some docs.
1 parent 763d3c0 commit 69fd538

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/ui-scripts/zoomer/zoomer.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use strict";
22

33
// TODO: when width is 1px and mousewheeling, don't move
4-
// TODO: prevent context menu
54

65
/**
76
* @constructor
@@ -318,6 +317,9 @@ var ZoomerPrototype = function()
318317
window.requestAnimationFrame(this._update_bound);
319318
};
320319

320+
/**
321+
* Updates the overlay position and the model area.
322+
*/
321323
this._update = function()
322324
{
323325
this._update_overlay_position();
@@ -336,6 +338,9 @@ var ZoomerPrototype = function()
336338
this._overlay_ele.style.right = this._overlay_right + "px";
337339
};
338340

341+
/**
342+
* Sets the model area.
343+
*/
339344
this._set_model_area = function()
340345
{
341346
var ms_unit = this._model.get_duration() / this._model.get_model_element_width();
@@ -352,6 +357,9 @@ var ZoomerPrototype = function()
352357
return this._zoomer_ele_width - left_x;
353358
};
354359

360+
/**
361+
* Finalizes the setup by adding all events.
362+
*/
355363
this._finalize = function()
356364
{
357365
this._zoomer_ele.addEventListener("mousewheel", this._zoomer_ele_onmousewheel_bound);
@@ -362,6 +370,9 @@ var ZoomerPrototype = function()
362370
this._handle_right_ele.addEventListener("mousedown", this._handle_ele_onmousedown_bound);
363371
};
364372

373+
/**
374+
* Resets the state of the overlay.
375+
*/
365376
this.reset = function()
366377
{
367378
this._overlay_left = 0;
@@ -405,7 +416,8 @@ var ZoomerPrototype = function()
405416
};
406417

407418
/**
408-
*
419+
* Move the overlay. A negative value moves the overlay to the left,
420+
* a positive to the right.
409421
*/
410422
this.move_overlay = function(diff)
411423
{
@@ -420,7 +432,7 @@ var ZoomerPrototype = function()
420432
};
421433

422434
/**
423-
*
435+
* Changes the size of the overlay.
424436
*/
425437
this.change_overlay_size = function(left_diff, right_diff)
426438
{
@@ -435,7 +447,8 @@ var ZoomerPrototype = function()
435447
};
436448

437449
/**
438-
*
450+
* Sets the left and right position of the overlay internally. To change
451+
* the element position, _update_overlay_position has to be called.
439452
*/
440453
this.set_overlay_position = function(left, right)
441454
{

0 commit comments

Comments
 (0)