| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * Copyright (C) 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 _onKeyDown: function(event) | 196 _onKeyDown: function(event) |
| 197 { | 197 { |
| 198 // Escape Key will clear the field and clear the search results | 198 // Escape Key will clear the field and clear the search results |
| 199 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) { | 199 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) { |
| 200 // If focus belongs here and text is empty - nothing to do, return u
nhandled. | 200 // If focus belongs here and text is empty - nothing to do, return u
nhandled. |
| 201 // When search was selected manually and is currently blank, we'd li
ke Esc stay unhandled | 201 // When search was selected manually and is currently blank, we'd li
ke Esc stay unhandled |
| 202 // and hit console drawer handler. | 202 // and hit console drawer handler. |
| 203 if (event.target.value === "") | 203 if (event.target.value === "") |
| 204 return; | 204 return; |
| 205 | 205 |
| 206 event.consume(); | 206 event.consume(true); |
| 207 | 207 |
| 208 this.cancelSearch(); | 208 this.cancelSearch(); |
| 209 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElemen
t()); | 209 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElemen
t()); |
| 210 if (WebInspector.currentFocusElement() === event.target) | 210 if (WebInspector.currentFocusElement() === event.target) |
| 211 WebInspector.currentFocusElement().select(); | 211 WebInspector.currentFocusElement().select(); |
| 212 return false; | 212 return false; |
| 213 } | 213 } |
| 214 | 214 |
| 215 if (!isEnterKey(event)) | 215 if (!isEnterKey(event)) |
| 216 return false; | 216 return false; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 currentPanel.currentQuery = query; | 296 currentPanel.currentQuery = query; |
| 297 currentPanel.performSearch(query); | 297 currentPanel.performSearch(query); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 /** | 301 /** |
| 302 * @type {?WebInspector.SearchController} | 302 * @type {?WebInspector.SearchController} |
| 303 */ | 303 */ |
| 304 WebInspector.searchController = null; | 304 WebInspector.searchController = null; |
| OLD | NEW |