Commit 815e8d6e authored by luoe's avatar luoe Committed by Commit Bot

DevTools: migrate sources navigator to shadow

BUG=726972

Review-Url: https://codereview.chromium.org/2924413002
Cr-Commit-Position: refs/heads/master@{#478745}
parent 9d2ed164
......@@ -31,13 +31,13 @@
*/
Sources.NavigatorView = class extends UI.VBox {
constructor() {
super();
super(true);
this.registerRequiredCSS('sources/navigatorView.css');
this._scriptsTree = new UI.TreeOutlineInShadow();
this._scriptsTree.registerRequiredCSS('sources/navigatorTree.css');
this._scriptsTree.setComparator(Sources.NavigatorView._treeElementsCompare);
this.element.appendChild(this._scriptsTree.element);
this.contentElement.appendChild(this._scriptsTree.element);
this.setDefaultFocusedElement(this._scriptsTree.element);
/** @type {!Multimap<!Workspace.UISourceCode, !Sources.NavigatorUISourceCodeTreeNode>} */
......@@ -51,7 +51,7 @@ Sources.NavigatorView = class extends UI.VBox {
/** @type {!Map.<!SDK.ResourceTreeFrame, !Sources.NavigatorGroupTreeNode>} */
this._frameNodes = new Map();
this.element.addEventListener('contextmenu', this.handleContextMenu.bind(this), false);
this.contentElement.addEventListener('contextmenu', this.handleContextMenu.bind(this), false);
this._navigatorGroupByFolderSetting = Common.moduleSetting('navigatorGroupByFolder');
this._navigatorGroupByFolderSetting.addChangeListener(this._groupingChanged.bind(this));
......
......@@ -147,7 +147,7 @@ Sources.FilesNavigatorView = class extends Sources.NavigatorView {
addButton.addEventListener(
UI.ToolbarButton.Events.Click, () => Persistence.isolatedFileSystemManager.addFileSystem());
toolbar.appendToolbarItem(addButton);
this.element.insertBefore(toolbar.element, this.element.firstChild);
this.contentElement.insertBefore(toolbar.element, this.contentElement.firstChild);
}
/**
......@@ -198,7 +198,7 @@ Sources.SnippetsNavigatorView = class extends Sources.NavigatorView {
var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('New snippet'));
newButton.addEventListener(UI.ToolbarButton.Events.Click, this._handleCreateSnippet.bind(this));
toolbar.appendToolbarItem(newButton);
this.element.insertBefore(toolbar.element, this.element.firstChild);
this.contentElement.insertBefore(toolbar.element, this.contentElement.firstChild);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment