OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 this._prompt.on(UI.TextPrompt.TextChangedEvent, this._applyFreeFlowStyleTe
xtEdit.bind(this)); | 2362 this._prompt.on(UI.TextPrompt.TextChangedEvent, this._applyFreeFlowStyleTe
xtEdit.bind(this)); |
2363 | 2363 |
2364 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis
tener.bind(this, context)); | 2364 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis
tener.bind(this, context)); |
2365 this._navigateToSource(selectElement, true); | 2365 this._navigateToSource(selectElement, true); |
2366 | 2366 |
2367 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind(
this, context), false); | 2367 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind(
this, context), false); |
2368 proxyElement.addEventListener('keypress', this._editingNameValueKeyPress.bin
d(this, context), false); | 2368 proxyElement.addEventListener('keypress', this._editingNameValueKeyPress.bin
d(this, context), false); |
2369 if (isEditingName) | 2369 if (isEditingName) |
2370 proxyElement.addEventListener('paste', pasteHandler.bind(this, context), f
alse); | 2370 proxyElement.addEventListener('paste', pasteHandler.bind(this, context), f
alse); |
2371 | 2371 |
2372 selectElement.getComponentSelection().setBaseAndExtent(selectElement, 0, sel
ectElement, 1); | 2372 selectElement.getComponentSelection().setBaseAndExtent( |
| 2373 selectElement, 0, selectElement, selectElement.firstChild ? 1 : 0); |
2373 } | 2374 } |
2374 | 2375 |
2375 /** | 2376 /** |
2376 * @param {!Elements.StylePropertyTreeElement.Context} context | 2377 * @param {!Elements.StylePropertyTreeElement.Context} context |
2377 * @param {!Event} event | 2378 * @param {!Event} event |
2378 */ | 2379 */ |
2379 _editingNameValueKeyDown(context, event) { | 2380 _editingNameValueKeyDown(context, event) { |
2380 if (event.handled) | 2381 if (event.handled) |
2381 return; | 2382 return; |
2382 | 2383 |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 } | 3081 } |
3081 | 3082 |
3082 /** | 3083 /** |
3083 * @override | 3084 * @override |
3084 * @return {!UI.ToolbarItem} | 3085 * @return {!UI.ToolbarItem} |
3085 */ | 3086 */ |
3086 item() { | 3087 item() { |
3087 return this._button; | 3088 return this._button; |
3088 } | 3089 } |
3089 }; | 3090 }; |
OLD | NEW |