Commit b0a6debf authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Polish uiSourceCode context menu on sources panel.

BUG=378942

Review URL: https://codereview.chromium.org/316153002

git-svn-id: svn://svn.chromium.org/blink/trunk@175866 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4e85baa0
......@@ -315,6 +315,14 @@ WebInspector.NavigatorView.prototype = {
this.create(project, path, uiSourceCode);
},
/**
* @param {!WebInspector.UISourceCode} uiSourceCode
*/
_handleContextMenuRename: function(uiSourceCode)
{
this.rename(uiSourceCode, false);
},
/**
* @param {!WebInspector.Project} project
* @param {string} path
......@@ -350,12 +358,14 @@ WebInspector.NavigatorView.prototype = {
contextMenu.appendSeparator();
var project = uiSourceCode.project();
var path = uiSourceCode.parentPath();
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Refresh parent" : "Refresh Parent"), this._handleContextMenuRefresh.bind(this, project, path));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Duplicate file" : "Duplicate File"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Exclude parent folder" : "Exclude Parent Folder"), this._handleContextMenuExclude.bind(this, project, path));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Delete file" : "Delete File"), this._handleContextMenuDelete.bind(this, uiSourceCode));
contextMenu.appendSeparator();
if (project.type() === WebInspector.projectTypes.FileSystem) {
var path = uiSourceCode.parentPath();
contextMenu.appendItem(WebInspector.UIString("Rename\u2026"), this._handleContextMenuRename.bind(this, uiSourceCode));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Make a copy\u2026" : "Make a Copy\u2026"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode));
contextMenu.appendItem(WebInspector.UIString("Delete"), this._handleContextMenuDelete.bind(this, uiSourceCode));
contextMenu.appendSeparator();
}
this._appendAddFolderItem(contextMenu);
contextMenu.show();
},
......
......@@ -890,7 +890,9 @@ WebInspector.SourcesPanel.prototype = {
return;
var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Local modifications\u2026" : "Local Modifications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
var project = uiSourceCode.project();
if (project.type() !== WebInspector.projectTypes.FileSystem)
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Local modifications\u2026" : "Local Modifications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
if (!event.target.isSelfOrDescendant(this.editorView.sidebarElement())) {
......
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