Bug 1561435 - Format devtools/client/, a=automatic-formatting

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884
This commit is contained in:
Victor Porof
2019-07-05 11:24:38 +02:00
parent e1ef9c4c20
commit b7732ae890
2792 changed files with 96115 additions and 52865 deletions

View File

@@ -6,11 +6,22 @@
"use strict";
const { createFactory, createElement } = require("devtools/client/shared/vendor/react");
const {
createFactory,
createElement,
} = require("devtools/client/shared/vendor/react");
const { Provider } = require("devtools/client/shared/vendor/react-redux");
loader.lazyRequireGetter(this, "ChangesContextMenu", "devtools/client/inspector/changes/ChangesContextMenu");
loader.lazyRequireGetter(this, "clipboardHelper", "devtools/shared/platform/clipboard");
loader.lazyRequireGetter(
this,
"ChangesContextMenu",
"devtools/client/inspector/changes/ChangesContextMenu"
);
loader.lazyRequireGetter(
this,
"clipboardHelper",
"devtools/shared/platform/clipboard"
);
const ChangesApp = createFactory(require("./components/ChangesApp"));
const { getChangesStylesheet } = require("./selectors/changes");
@@ -25,10 +36,7 @@ const {
TELEMETRY_SCALAR_COPY_RULE,
} = require("./constants");
const {
resetChanges,
trackChange,
} = require("./actions/changes");
const { resetChanges, trackChange } = require("./actions/changes");
class ChangesView {
constructor(inspector, window) {
@@ -71,11 +79,15 @@ class ChangesView {
this._getChangesFront();
// Expose the provider to let inspector.js use it in setupSidebar.
this.provider = createElement(Provider, {
id: "changesview",
key: "changesview",
store: this.store,
}, changesApp);
this.provider = createElement(
Provider,
{
id: "changesview",
key: "changesview",
store: this.store,
},
changesApp
);
this.inspector.target.on("will-navigate", this.onClearChanges);
}
@@ -160,8 +172,10 @@ class ChangesView {
* Host element of a CSS declaration rendered the Changes panel.
*/
copyDeclaration(element) {
const name = element.querySelector(".changes__declaration-name").textContent;
const value = element.querySelector(".changes__declaration-value").textContent;
const name = element.querySelector(".changes__declaration-name")
.textContent;
const value = element.querySelector(".changes__declaration-value")
.textContent;
const isRemoved = element.classList.contains("diff-remove");
const text = isRemoved ? `/* ${name}: ${value}; */` : `${name}: ${value};`;
clipboardHelper.copyString(text);