src/viewer-selector.js
function ViewerSelector(defaultViewer) {
  // Try to load the selected key from local storage.
  try {
    this.selectedKey = localStorage.getItem(VIEWER_KEY);
  } catch (error) {
    console.error('Failed to load viewer profile: %s', error);
  }

  //If none exists, or if localstorage is unavailable, use the default key.
  if (!this.selectedKey) {
    this.selectedKey = defaultViewer || DEFAULT_VIEWER;
  }

  this.dialog = this.createDialog_(DeviceInfo.Viewers);
  this.root = null;
  this.onChangeCallbacks_ = [];
}
function ViewerSelector(defaultViewer) {
  // Try to load the selected key from local storage.
  try {
    this.selectedKey = localStorage.getItem(VIEWER_KEY);
  } catch (error) {
    console.error('Failed to load viewer profile: %s', error);
  }

  //If none exists, or if localstorage is unavailable, use the default key.
  if (!this.selectedKey) {
    this.selectedKey = defaultViewer || DEFAULT_VIEWER;
  }

  this.dialog = this.createDialog_(DeviceInfo.Viewers);
  this.root = null;
  this.onChangeCallbacks_ = [];
}
function ViewerSelector ( defaultViewer ) { // Try to load the selected key from local storage. try { this . selectedKey = localStorage . getItem ( VIEWER_KEY ) ; } catch ( error ) { console . error ( 'Failed to load viewer profile: %s' , error ) ; } //If none exists, or if localstorage is unavailable, use the default key. if ( ! this . selectedKey ) { this . selectedKey = defaultViewer || DEFAULT_VIEWER ; } this . dialog = this . createDialog_ ( DeviceInfo . Viewers ) ; this . root = null ; this . onChangeCallbacks_ = [ ] ; }
Creates a viewer selector with the options specified. Supports being shown
and hidden. Generates events when viewer parameters change. Also supports
saving the currently selected index in localStorage.
Creates a viewer selector with the options specified . Supports being shown and hidden . Generates events when viewer parameters change . Also supports saving the currently selected index in localStorage .