tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

read-only-container.js (1131B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const ReadOnlyEditor = require("resource://devtools/client/inspector/markup/views/read-only-editor.js");
      8 const MarkupContainer = require("resource://devtools/client/inspector/markup/views/markup-container.js");
      9 
     10 /**
     11 * An implementation of MarkupContainer for Pseudo Elements,
     12 * Doctype nodes, or any other type generic node that doesn't
     13 * fit for other editors.
     14 * Does not allow any editing, just viewing / selecting.
     15 */
     16 class MarkupReadOnlyContainer extends MarkupContainer {
     17  /**
     18   *
     19   * @param  {MarkupView} markupView
     20   *         The markup view that owns this container.
     21   * @param  {NodeFront} node
     22   *         The node to display.
     23   */
     24  constructor(markupView, node) {
     25    super();
     26    super.initialize(markupView, node, "readonlycontainer");
     27 
     28    this.editor = new ReadOnlyEditor(this, node);
     29    this.tagLine.appendChild(this.editor.elt);
     30  }
     31 }
     32 
     33 module.exports = MarkupReadOnlyContainer;