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

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

Issue 2843203003: DevTools: pressing enter in bound input fields should not fire change handler (Closed)
Patch Set: keep enter listener and add preventDefault Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 apply(input.value); 1554 apply(input.value);
1555 } 1555 }
1556 1556
1557 /** 1557 /**
1558 * @param {!Event} event 1558 * @param {!Event} event
1559 */ 1559 */
1560 function onKeyDown(event) { 1560 function onKeyDown(event) {
1561 if (isEnterKey(event)) { 1561 if (isEnterKey(event)) {
1562 if (validate(input.value)) 1562 if (validate(input.value))
1563 apply(input.value); 1563 apply(input.value);
1564 event.preventDefault();
1564 return; 1565 return;
1565 } 1566 }
1566 1567
1567 if (!numeric) 1568 if (!numeric)
1568 return; 1569 return;
1569 1570
1570 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1 : 0; 1571 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1 : 0;
1571 if (!increment) 1572 if (!increment)
1572 return; 1573 return;
1573 if (event.shiftKey) 1574 if (event.shiftKey)
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 */ 2072 */
2072 constructor(message, okCallback, cancelCallback) { 2073 constructor(message, okCallback, cancelCallback) {
2073 super(true); 2074 super(true);
2074 this.registerRequiredCSS('ui/confirmDialog.css'); 2075 this.registerRequiredCSS('ui/confirmDialog.css');
2075 this.contentElement.createChild('div', 'message').createChild('span').textCo ntent = message; 2076 this.contentElement.createChild('div', 'message').createChild('span').textCo ntent = message;
2076 var buttonsBar = this.contentElement.createChild('div', 'button'); 2077 var buttonsBar = this.contentElement.createChild('div', 'button');
2077 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback )); 2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback ));
2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel Callback)); 2079 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel Callback));
2079 } 2080 }
2080 }; 2081 };
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