dist/scroll-indicator.js
/**
 * Instantiates the IndicatorView instance.
 *
 * The IndicatorView supports two "types" of indicators: "position" and "event".
 * Event indicators inform the user that the remote user is actively scrolling,
 * while position indicators confer the relative position of the remote user's
 * viewport.
 *
 * The general behaviour of this class can be summed up as follows:
 *  - Event/position indicators stack in the same container, and may be
 *    intermixed.
 *  - There is only one indicator shown per user/direction at a time.
 *  - If event and position indicators for the same user/direction are
 *    concurrent, the event indicator is shown and the position indicator is
 *    hidden.
 *  - The event indicator times out. Calling {@link #showEventIndicator} again
 *    with the same arguments resets the timer.
 *  - The position indicator must be explicitly removed with
 *    {@link #removePositionIndicator}.
 *
 * @constructor
 */
Instantiates the IndicatorView instance.

The general behaviour of this class can be summed up as follows:
- Event/position indicators stack in the same container, and may be
intermixed.
- There is only one indicator shown per user/direction at a time.
- If event and position indicators for the same user/direction are
concurrent, the event indicator is shown and the position indicator is
hidden.
- The event indicator times out. Calling  #showEventIndicator again
with the same arguments resets the timer.
- The position indicator must be explicitly removed with
#removePositionIndicator.

@constructor
Instantiates the IndicatorView instance . The general behaviour of this class can be summed up as follows : - Event / position indicators stack in the same container and may be intermixed . - There is only one indicator shown per user / direction at a time . - If event and position indicators for the same user / direction are concurrent the event indicator is shown and the position indicator is hidden . - The event indicator times out . Calling #showEventIndicator again with the same arguments resets the timer . - The position indicator must be explicitly removed with #removePositionIndicator . @constructor
function IndicatorView(displayTimer) {
  var element = document.body;
  this._displayTimer = displayTimer;
  this._containers = {};
  this._containers.downRight = document.createElement('div');
  this._containers.downRight.className = CLASS_OVERRIDE + ' ' +
                                         CLASS_INDICATOR + '-down-right';
  this._containers.up = document.createElement('div');
  this._containers.up.className = CLASS_OVERRIDE + ' ' +
                                  CLASS_INDICATOR + '-up';
  this._containers.right = document.createElement('div');
  this._containers.right.className = CLASS_OVERRIDE + ' ' +
                                     CLASS_INDICATOR + '-right';
  this._containers.left = document.createElement('div');
  this._containers.left.className = CLASS_OVERRIDE + ' ' +
                                    CLASS_INDICATOR + '-left';
  this._containers.down = document.createElement('div');
  this._containers.down.className = CLASS_OVERRIDE + ' ' +
                                    CLASS_INDICATOR + '-down';
  this._containers.downRight.appendChild(this._containers.down);
  this._containers.downRight.appendChild(this._containers.right);
  element.appendChild(this._containers.up);
  element.appendChild(this._containers.left);
  element.appendChild(this._containers.downRight);
  this._timeouts = {
    up: {},
    down: {},
    left: {},
    right: {}
  };
}
function IndicatorView ( displayTimer ) { var element = document . body ; this . _displayTimer = displayTimer ; this . _containers = { } ; this . _containers . downRight = document . createElement ( 'div' ) ; this . _containers . downRight . className = CLASS_OVERRIDE + ' ' + CLASS_INDICATOR + '-down-right' ; this . _containers . up = document . createElement ( 'div' ) ; this . _containers . up . className = CLASS_OVERRIDE + ' ' + CLASS_INDICATOR + '-up' ; this . _containers . right = document . createElement ( 'div' ) ; this . _containers . right . className = CLASS_OVERRIDE + ' ' + CLASS_INDICATOR + '-right' ; this . _containers . left = document . createElement ( 'div' ) ; this . _containers . left . className = CLASS_OVERRIDE + ' ' + CLASS_INDICATOR + '-left' ; this . _containers . down = document . createElement ( 'div' ) ; this . _containers . down . className = CLASS_OVERRIDE + ' ' + CLASS_INDICATOR + '-down' ; this . _containers . downRight . appendChild ( this . _containers . down ) ; this . _containers . downRight . appendChild ( this . _containers . right ) ; element . appendChild ( this . _containers . up ) ; element . appendChild ( this . _containers . left ) ; element . appendChild ( this . _containers . downRight ) ; this . _timeouts = { up : { } , down : { } , left : { } , right : { } } ; }
Instantiates the IndicatorView instance.
Instantiates the IndicatorView instance .
// If these indicators are for the window, pretend the container is the body // instead. // Track the event indicator timeouts for each direction, indexed by user. // TODO : This could result in many simultaneous timeouts, which is bad for // performance. We could use the class in platform/client/util/timeouts.js // to address this.