Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1551 var valid = validate(input.value); | 1551 var valid = validate(input.value); |
| 1552 input.classList.toggle('error-input', !valid); | 1552 input.classList.toggle('error-input', !valid); |
| 1553 if (valid) | 1553 if (valid) |
| 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)) { | |
|
dgozman
2017/04/27 22:58:55
Why was this introduced in first place? Was it the
luoe
2017/04/29 03:29:59
As far as I can tell, the history looks like this:
| |
| 1562 if (validate(input.value)) | |
| 1563 apply(input.value); | |
| 1564 return; | |
| 1565 } | |
| 1566 | |
| 1567 if (!numeric) | 1561 if (!numeric) |
| 1568 return; | 1562 return; |
| 1569 | 1563 |
| 1570 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1 : 0; | 1564 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1 : 0; |
| 1571 if (!increment) | 1565 if (!increment) |
| 1572 return; | 1566 return; |
| 1573 if (event.shiftKey) | 1567 if (event.shiftKey) |
| 1574 increment *= 10; | 1568 increment *= 10; |
| 1575 | 1569 |
| 1576 var value = input.value; | 1570 var value = input.value; |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2071 */ | 2065 */ |
| 2072 constructor(message, okCallback, cancelCallback) { | 2066 constructor(message, okCallback, cancelCallback) { |
| 2073 super(true); | 2067 super(true); |
| 2074 this.registerRequiredCSS('ui/confirmDialog.css'); | 2068 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2075 this.contentElement.createChild('div', 'message').createChild('span').textCo ntent = message; | 2069 this.contentElement.createChild('div', 'message').createChild('span').textCo ntent = message; |
| 2076 var buttonsBar = this.contentElement.createChild('div', 'button'); | 2070 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2077 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback )); | 2071 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback )); |
| 2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel Callback)); | 2072 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel Callback)); |
| 2079 } | 2073 } |
| 2080 }; | 2074 }; |
| OLD | NEW |