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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js

Issue 2674453002: DevTools: Properly restore focus after tabbing through inplace editors (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 UI.InplaceEditor = class { 7 UI.InplaceEditor = class {
8 /** 8 /**
9 * @param {!Element} element 9 * @param {!Element} element
10 * @param {!UI.InplaceEditor.Config=} config 10 * @param {!UI.InplaceEditor.Config=} config
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 function handleEditingResult(result, event) { 160 function handleEditingResult(result, event) {
161 if (result === 'commit') { 161 if (result === 'commit') {
162 editingCommitted.call(element); 162 editingCommitted.call(element);
163 event.consume(true); 163 event.consume(true);
164 } else if (result === 'cancel') { 164 } else if (result === 'cancel') {
165 editingCancelled.call(element); 165 editingCancelled.call(element);
166 event.consume(true); 166 event.consume(true);
167 } else if (result && result.startsWith('move-')) { 167 } else if (result && result.startsWith('move-')) {
168 moveDirection = result.substring(5); 168 moveDirection = result.substring(5);
169 if (event.key !== 'Tab') 169 if (event.key === 'Tab')
170 blurEventListener(); 170 event.consume(true);
171 blurEventListener();
171 } 172 }
172 } 173 }
173 174
174 /** 175 /**
175 * @param {!Event} event 176 * @param {!Event} event
176 */ 177 */
177 function pasteEventListener(event) { 178 function pasteEventListener(event) {
178 var result = pasteCallback(event); 179 var result = pasteCallback(event);
179 handleEditingResult(result, event); 180 handleEditingResult(result, event);
180 } 181 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 this.smartIndent = smartIndent; 260 this.smartIndent = smartIndent;
260 } 261 }
261 262
262 /** 263 /**
263 * @param {function(!Event):string} postKeydownFinishHandler 264 * @param {function(!Event):string} postKeydownFinishHandler
264 */ 265 */
265 setPostKeydownFinishHandler(postKeydownFinishHandler) { 266 setPostKeydownFinishHandler(postKeydownFinishHandler) {
266 this.postKeydownFinishHandler = postKeydownFinishHandler; 267 this.postKeydownFinishHandler = postKeydownFinishHandler;
267 } 268 }
268 }; 269 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698