Commit d722a94d authored by lushnikov's avatar lushnikov Committed by Commit bot

DevTools: [Persistence] green checkmark icons should not be editable

Today, navigator renders green checkmarks as a part of the title element.
This results in the editing field spanning over the icon as well.

This patch starts using treeelement.setTrailingIcons() method to
avoid this problem.

BUG=673086
R=dgozman

Review-Url: https://codereview.chromium.org/2568623002
Cr-Commit-Position: refs/heads/master@{#438016}
parent 6ec9ba03
...@@ -360,11 +360,15 @@ InspectorTest.dumpNavigatorView = function(navigatorView) ...@@ -360,11 +360,15 @@ InspectorTest.dumpNavigatorView = function(navigatorView)
function dumpNavigatorTreeElement(prefix, treeElement) function dumpNavigatorTreeElement(prefix, treeElement)
{ {
var titleText; var titleText = treeElement.title;
if (treeElement.title instanceof Element) if (treeElement._trailingIconsElement) {
titleText = treeElement.title.firstChild.textContent + " [mapped]"; var iconTypes = [];
else for (var icon = treeElement._trailingIconsElement.firstChild; icon; icon = icon.nextSibling) {
titleText = treeElement.title; iconTypes.push(icon._iconType);
}
if (iconTypes.length)
titleText = titleText + " [" + iconTypes.join(", ") + "]";
}
if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem || treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) { if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem || treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) {
var hasMappedFiles = treeElement.listItemElement.classList.contains("has-mapped-files"); var hasMappedFiles = treeElement.listItemElement.classList.contains("has-mapped-files");
if (!hasMappedFiles) if (!hasMappedFiles)
......
...@@ -25,7 +25,7 @@ top ...@@ -25,7 +25,7 @@ top
inspector inspector
persistence persistence
resources resources
foo.js [mapped] foo.js [smallicon-green-checkmark]
persistence-navigator.html persistence-navigator.html
persistence-test.js persistence-test.js
debugger-test.js debugger-test.js
...@@ -33,7 +33,7 @@ top ...@@ -33,7 +33,7 @@ top
isolated-filesystem-test.js isolated-filesystem-test.js
www www
inspector/persistence/resources inspector/persistence/resources
foo.js [mapped] foo.js [smallicon-green-checkmark]
Running: removeFileMapping Running: removeFileMapping
top top
......
...@@ -1257,16 +1257,15 @@ Sources.NavigatorUISourceCodeTreeNode = class extends Sources.NavigatorTreeNode ...@@ -1257,16 +1257,15 @@ Sources.NavigatorUISourceCodeTreeNode = class extends Sources.NavigatorTreeNode
(this._uiSourceCode.isDirty() || Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode))) (this._uiSourceCode.isDirty() || Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)))
titleText = '*' + titleText; titleText = '*' + titleText;
this._treeElement.title = titleText;
var binding = Persistence.persistence.binding(this._uiSourceCode); var binding = Persistence.persistence.binding(this._uiSourceCode);
if (binding && Runtime.experiments.isEnabled('persistence2')) { if (binding && Runtime.experiments.isEnabled('persistence2')) {
var titleElement = createElement('span'); var icon = UI.Icon.create('smallicon-green-checkmark');
titleElement.textContent = titleText;
var icon = UI.Icon.create('smallicon-checkmark', 'mapped-file-checkmark');
icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(this._uiSourceCode); icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(this._uiSourceCode);
titleElement.appendChild(icon); this._treeElement.setTrailingIcons([icon]);
this._treeElement.title = titleElement;
} else { } else {
this._treeElement.title = titleText; this._treeElement.setTrailingIcons([]);
} }
var tooltip = this._uiSourceCode.url(); var tooltip = this._uiSourceCode.url();
......
...@@ -52,15 +52,6 @@ ...@@ -52,15 +52,6 @@
opacity: 0.5; opacity: 0.5;
} }
.mapped-file-checkmark {
background: #009802;
margin-left: 3px;
}
:focus .navigator-file-tree-item.selected .mapped-file-checkmark {
background: white !important;
}
:focus .navigator-file-tree-item.selected .icon { :focus .navigator-file-tree-item.selected .icon {
background: white !important; background: white !important;
} }
......
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