src/index.js
function(focusEl) {
    this.opened = true;
    Events.emit('inspectortoggle', true);

    if (this.sceneEl.hasAttribute('embedded')) {
      // Remove embedded styles, but keep track of it.
      this.sceneEl.removeAttribute('embedded');
      this.sceneEl.setAttribute('aframe-inspector-removed-embedded');
    }

    document.body.classList.add('aframe-inspector-opened');
    this.sceneEl.resize();
    this.sceneEl.pause();
    this.sceneEl.exitVR();

    Shortcuts.enable();

    // Trick scene to run the cursor tick.
    this.sceneEl.isPlaying = true;
    this.cursor.play();

    if (
      !focusEl &&
      this.isFirstOpen &&
      AFRAME.utils.getUrlParameter('inspector')
    ) {
      // Focus entity with URL parameter on first open.
      focusEl = document.getElementById(
        AFRAME.utils.getUrlParameter('inspector')
      );
    }
    if (focusEl) {
      this.selectEntity(focusEl);
      Events.emit('objectfocus', focusEl.object3D);
    }
    this.isFirstOpen = false;
  }
function(focusEl) {
    this.opened = true;
    Events.emit('inspectortoggle', true);

    if (this.sceneEl.hasAttribute('embedded')) {
      // Remove embedded styles, but keep track of it.
      this.sceneEl.removeAttribute('embedded');
      this.sceneEl.setAttribute('aframe-inspector-removed-embedded');
    }

    document.body.classList.add('aframe-inspector-opened');
    this.sceneEl.resize();
    this.sceneEl.pause();
    this.sceneEl.exitVR();

    Shortcuts.enable();

    // Trick scene to run the cursor tick.
    this.sceneEl.isPlaying = true;
    this.cursor.play();

    if (
      !focusEl &&
      this.isFirstOpen &&
      AFRAME.utils.getUrlParameter('inspector')
    ) {
      // Focus entity with URL parameter on first open.
      focusEl = document.getElementById(
        AFRAME.utils.getUrlParameter('inspector')
      );
    }
    if (focusEl) {
      this.selectEntity(focusEl);
      Events.emit('objectfocus', focusEl.object3D);
    }
    this.isFirstOpen = false;
  }
function ( focusEl ) { this . opened = true ; Events . emit ( 'inspectortoggle' , true ) ; if ( this . sceneEl . hasAttribute ( 'embedded' ) ) { // Remove embedded styles, but keep track of it. this . sceneEl . removeAttribute ( 'embedded' ) ; this . sceneEl . setAttribute ( 'aframe-inspector-removed-embedded' ) ; } document . body . classList . add ( 'aframe-inspector-opened' ) ; this . sceneEl . resize ( ) ; this . sceneEl . pause ( ) ; this . sceneEl . exitVR ( ) ; Shortcuts . enable ( ) ; // Trick scene to run the cursor tick. this . sceneEl . isPlaying = true ; this . cursor . play ( ) ; if ( ! focusEl && this . isFirstOpen && AFRAME . utils . getUrlParameter ( 'inspector' ) ) { // Focus entity with URL parameter on first open. focusEl = document . getElementById ( AFRAME . utils . getUrlParameter ( 'inspector' ) ) ; } if ( focusEl ) { this . selectEntity ( focusEl ) ; Events . emit ( 'objectfocus' , focusEl . object3D ) ; } this . isFirstOpen = false ; }
Open the editor UI
Open the editor UI