Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(843)

Unified Diff: Source/devtools/front_end/elements/ElementsTreeElement.js

Issue 1200833006: DevTools: [Elements] F2 should commit changes in edit-as-html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/elements/ElementsPanel.js ('k') | Source/devtools/front_end/ui/InplaceEditor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/ElementsTreeElement.js
diff --git a/Source/devtools/front_end/elements/ElementsTreeElement.js b/Source/devtools/front_end/elements/ElementsTreeElement.js
index cec3da0f1f6759093aaddc61d42dfa5a4ebdbd04..c23784a8a06d9e6211e39c884052aece2bc3cdce 100644
--- a/Source/devtools/front_end/elements/ElementsTreeElement.js
+++ b/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -666,24 +666,16 @@ WebInspector.ElementsTreeElement.prototype = {
var config = new WebInspector.InplaceEditor.Config(this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
- function handleKeyDownEvents(event)
+ /**
+ * @param {!Event} event
+ * @return {string}
+ */
+ function postKeyDownFinishHandler(event)
{
- var isMetaOrCtrl = WebInspector.isMac() ?
- event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey :
- event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey;
- if (isEnterKey(event) && (event.isMetaOrCtrlForTest || !config.multiline || isMetaOrCtrl))
- return "commit";
- else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === "U+001B")
- return "cancel";
- else if (event.keyIdentifier === "U+0009") // Tab key
- return "move-" + (event.shiftKey ? "backward" : "forward");
- else {
- WebInspector.handleElementValueModifications(event, attribute);
- return "";
- }
+ WebInspector.handleElementValueModifications(event, attribute);
+ return "";
}
-
- config.customFinishHandler = handleKeyDownEvents;
+ config.setPostKeydownFinishHandler(postKeyDownFinishHandler);
this._editing = WebInspector.InplaceEditor.startEditing(attribute, config);
« no previous file with comments | « Source/devtools/front_end/elements/ElementsPanel.js ('k') | Source/devtools/front_end/ui/InplaceEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698