Bug 1336198 - Part 1: Redux store should be initialized at the Inspector level. r=jdescottes

--HG--
rename : devtools/client/inspector/layout/store.js => devtools/client/inspector/store.js
This commit is contained in:
Gabriel Luong 2017-02-11 00:05:50 -05:00
Родитель fca73c3037
Коммит 649f28dd88
8 изменённых файлов: 29 добавлений и 26 удалений

Просмотреть файл

@ -34,6 +34,8 @@ const {CommandUtils} = require("devtools/client/shared/developer-toolbar");
const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
const clipboardHelper = require("devtools/shared/platform/clipboard");
const Store = require("devtools/client/inspector/store");
const {LocalizationHelper, localizeMarkup} = require("devtools/shared/l10n");
const INSPECTOR_L10N =
new LocalizationHelper("devtools/client/locales/inspector.properties");
@ -92,6 +94,7 @@ function Inspector(toolbox) {
this.panelWin.inspector = this;
this.highlighters = new HighlightersOverlay(this);
this.store = Store();
this.telemetry = new Telemetry();
this.nodeMenuTriggerInfo = null;
@ -910,7 +913,6 @@ Inspector.prototype = {
this.cancelUpdate();
this.target.off("will-navigate", this._onBeforeNavigate);
this.target.off("thread-paused", this.updateDebuggerPausedWarning);
this.target.off("thread-resumed", this.updateDebuggerPausedWarning);
this._toolbox.off("select", this.updateDebuggerPausedWarning);
@ -942,8 +944,6 @@ Inspector.prototype = {
this.teardownSplitter();
this.sidebar = null;
this.teardownToolbar();
this.breadcrumbs.destroy();
this.selection.off("new-node-front", this.onNewSelection);
@ -951,12 +951,14 @@ Inspector.prototype = {
let markupDestroyer = this._destroyMarkup();
this.panelWin.inspector = null;
this.target = null;
this.panelDoc = null;
this.panelWin = null;
this.breadcrumbs = null;
this._toolbox = null;
this.breadcrumbs = null;
this.panelDoc = null;
this.panelWin.inspector = null;
this.panelWin = null;
this.sidebar = null;
this.store = null;
this.target = null;
this.highlighters.destroy();
this.highlighters = null;

Просмотреть файл

@ -26,7 +26,6 @@ const {
} = require("./actions/highlighter-settings");
const App = createFactory(require("./components/App"));
const Store = require("./store");
const EditingSession = require("./utils/editing-session");
@ -42,7 +41,7 @@ function LayoutView(inspector, window) {
this.document = window.document;
this.highlighters = inspector.highlighters;
this.inspector = inspector;
this.store = null;
this.store = inspector.store;
this.walker = this.inspector.walker;
this.updateBoxModel = this.updateBoxModel.bind(this);
@ -72,7 +71,6 @@ LayoutView.prototype = {
}
this.layoutInspector = yield this.inspector.walker.getLayoutInspector();
let store = this.store = Store();
this.loadHighlighterSettings();
@ -232,7 +230,7 @@ LayoutView.prototype = {
});
let provider = createElement(Provider, {
store,
store: this.store,
id: "layoutview",
title: INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2"),
key: "layoutview",

Просмотреть файл

@ -13,6 +13,5 @@ DIRS += [
DevToolsModules(
'layout.js',
'store.js',
'types.js',
)

Просмотреть файл

@ -1,9 +0,0 @@
/* 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";
exports.boxModel = require("./box-model");
exports.grids = require("./grids");
exports.highlighterSettings = require("./highlighter-settings");

Просмотреть файл

@ -8,5 +8,4 @@ DevToolsModules(
'box-model.js',
'grids.js',
'highlighter-settings.js',
'index.js',
)

Просмотреть файл

@ -17,10 +17,12 @@ DevToolsModules(
'inspector-commands.js',
'inspector-search.js',
'panel.js',
'reducers.js',
'store.js',
'toolsidebar.js',
)
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
with Files('**'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')
with Files('**'):
BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')

Просмотреть файл

@ -0,0 +1,12 @@
/* 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";
// This file exposes the Redux reducers of the box model, grid and grid highlighter
// settings.
exports.boxModel = require("devtools/client/inspector/layout/reducers/box-model");
exports.grids = require("devtools/client/inspector/layout/reducers/grids");
exports.highlighterSettings = require("devtools/client/inspector/layout/reducers/highlighter-settings");

Просмотреть файл

@ -6,7 +6,7 @@
const { combineReducers } = require("devtools/client/shared/vendor/redux");
const createStore = require("devtools/client/shared/redux/create-store");
const reducers = require("./reducers/index");
const reducers = require("devtools/client/inspector/reducers");
const flags = require("devtools/shared/flags");
module.exports = function () {