Browse Source

Stop inserting title

Gregg Tavares 7 years ago
parent
commit
6b78c6ff2a
1 changed files with 1 additions and 19 deletions
  1. 1 19
      threejs/resources/threejs-lessons-helper.js

+ 1 - 19
threejs/resources/threejs-lessons-helper.js

@@ -153,26 +153,16 @@
     window.console.error = wrapFunc(window.console, 'error');
   }
 
-  /**
-   * @typedef {Object} GetWebGLContextOptions
-   * @property {boolean} [dontResize] by default `getWebGLContext` will resize the canvas to match the size it's displayed.
-   * @property {boolean} [noTitle] by default inserts a copy of the `<title>` content into the page
-   * @memberOf module:webgl-utils
-   */
-
   /**
    * Gets a WebGL context.
    * makes its backing store the size it is displayed.
    * @param {HTMLCanvasElement} canvas a canvas element.
-   * @param {module:webgl-utils.GetThreejsContextOptions} [opt_options] options
    * @memberOf module:webgl-utils
    */
-  var setupLesson = function(canvas, opt_options) {
+  var setupLesson = function(canvas) {
     // only once
     setupLesson = function() {};
 
-    var options = opt_options || {};
-
     if (canvas) {
       canvas.addEventListener('webglcontextlost', function(e) {
           // the default is to do nothing. Preventing the default
@@ -194,14 +184,6 @@
 
     if (isInIFrame()) {
       updateCSSIfInIFrame();
-    } else if (!options.noTitle && options.title !== false) {
-      var titleElem = document.querySelector("title");
-      if (titleElem && titleElem.getAttribute("addtitletodoc") !== "false") {
-        var title = document.title;
-        var h1 = document.createElement("h1");
-        h1.innerText = title;
-        document.body.insertBefore(h1, document.body.children[0]);
-      }
     }
   };