tor-browser

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

flexbox.js (1338B)


      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 {
      8  CLEAR_FLEXBOX,
      9  UPDATE_FLEXBOX,
     10  UPDATE_FLEXBOX_COLOR,
     11  UPDATE_FLEXBOX_HIGHLIGHTED,
     12 } = require("resource://devtools/client/inspector/flexbox/actions/index.js");
     13 
     14 module.exports = {
     15  /**
     16   * Clears the flexbox state by resetting it back to the initial flexbox state.
     17   */
     18  clearFlexbox() {
     19    return {
     20      type: CLEAR_FLEXBOX,
     21    };
     22  },
     23 
     24  /**
     25   * Updates the flexbox state with the newly selected flexbox.
     26   */
     27  updateFlexbox(flexbox) {
     28    return {
     29      type: UPDATE_FLEXBOX,
     30      flexbox,
     31    };
     32  },
     33 
     34  /**
     35   * Updates the color used for the flexbox's highlighter.
     36   *
     37   * @param  {string} color
     38   *         The color to use for this nodeFront's flexbox highlighter.
     39   */
     40  updateFlexboxColor(color) {
     41    return {
     42      type: UPDATE_FLEXBOX_COLOR,
     43      color,
     44    };
     45  },
     46 
     47  /**
     48   * Updates the flexbox highlighted state.
     49   *
     50   * @param  {boolean} highlighted
     51   *         Whether or not the flexbox highlighter is highlighting the flexbox.
     52   */
     53  updateFlexboxHighlighted(highlighted) {
     54    return {
     55      type: UPDATE_FLEXBOX_HIGHLIGHTED,
     56      highlighted,
     57    };
     58  },
     59 };