gecko-dev/devtools/client/inspector/events/events.js
Mark Banner c32982b1f3 Bug 1371293 - Fix instances of padded-blocks failures after ESLint 4 upgrade. r=miker
MozReview-Commit-ID: I9sfn7n7UBs

--HG--
extra : rebase_source : e210706366189a26e3a827502f0de60e6ba1fdba
2017-11-06 13:45:49 +00:00

51 lines
1.3 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { createFactory, createElement } = require("devtools/client/shared/vendor/react");
const { Provider } = require("devtools/client/shared/vendor/react-redux");
const EventsApp = createFactory(require("./components/EventsApp"));
const { LocalizationHelper } = require("devtools/shared/l10n");
const INSPECTOR_L10N =
new LocalizationHelper("devtools/client/locales/inspector.properties");
class EventsView {
constructor(inspector, window) {
this.document = window.document;
this.inspector = inspector;
this.store = inspector.store;
this.init();
}
init() {
if (!this.inspector) {
return;
}
let eventsApp = EventsApp({});
let provider = createElement(Provider, {
id: "eventsview",
key: "eventsview",
store: this.store,
title: INSPECTOR_L10N.getStr("inspector.sidebar.eventsViewTitle")
}, eventsApp);
// Expose the provider to let inspector.js use it in setupSidebar.
this.provider = provider;
}
destroy() {
this.document = null;
this.inspector = null;
this.store = null;
}
}
module.exports = EventsView;