Skip to content
Snippets Groups Projects
Commit 7ad32ef2 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent d9f9ae2a
No related branches found
No related tags found
No related merge requests found
...@@ -712,7 +712,8 @@ ...@@ -712,7 +712,8 @@
</div> </div>
<div id="virtualReality" class="hide indent smallTxt"> <div id="virtualReality" class="hide indent smallTxt">
Status: &nbsp;<span id="VRstatus"></span><a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a> Status: &nbsp;<span id="VRstatus"></span><a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a>
<div id="VRoptions"> <div id="VRoptions"><br/>
<a href="#" id="enterVR" class="displayBlock btn btn-lg btn-inverse"></a>
</div><br/><br/> </div><br/><br/>
</div><br/> </div><br/>
<div> <div>
......
...@@ -56,13 +56,16 @@ function initViveInterface(globals){ ...@@ -56,13 +56,16 @@ function initViveInterface(globals){
var scale = 0.5; var scale = 0.5;
function connect(){ function connect(){
WEBVR.getVRDisplay( function ( display ) { WEBVR.getVRDisplay( function ( display ) {
if (!display) return; if (!display) return;
$status.html("VR device detected."); $status.html("VR device detected.");
var button = WEBVR.getButton( display, globals.threeView.renderer.domElement ); var button = WEBVR.getButton( display, globals.threeView.renderer.domElement );
$("#VRoptions").html(button); var $link = $("#enterVR");
$link.html(button.textContent);
var callback = button.onclick; var callback = button.onclick;
button.onclick = function () { $link.click(function(e){
e.preventDefault();
globals.vrEnabled = !display.isPresenting; globals.vrEnabled = !display.isPresenting;
var y = 0; var y = 0;
if (globals.vrEnabled) y = yOffset; if (globals.vrEnabled) y = yOffset;
...@@ -76,7 +79,7 @@ function initViveInterface(globals){ ...@@ -76,7 +79,7 @@ function initViveInterface(globals){
}); });
setControllerEvents(); setControllerEvents();
if (callback) callback(); if (callback) callback();
}; });
} ); } );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment