Changeset 109348 in webkit
- Timestamp:
- Mar 1, 2012, 8:16:54 AM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
inspector/front-end/PropertiesSection.js (modified) (1 diff)
-
inspector/front-end/Spectrum.js (modified) (3 diffs)
-
inspector/front-end/treeoutline.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109347 r109348 1 2012-03-01 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: hide color picker on Esc and Enter. 4 https://bugs.webkit.org/show_bug.cgi?id=79915 5 6 Reviewed by Vsevolod Vlasov. 7 8 * inspector/front-end/Spectrum.js: 9 (WebInspector.Spectrum.prototype.reposition): 10 (WebInspector.Spectrum.prototype.hide): 11 (WebInspector.Spectrum.prototype._onKeyDown): 12 1 13 2012-03-01 Huang Dongsung <luxtella@company100.net> 2 14 -
trunk/Source/WebCore/inspector/front-end/PropertiesSection.js
r96816 r109348 40 40 this.propertiesElement = document.createElement("ol"); 41 41 this.propertiesElement.className = "properties properties-tree monospace"; 42 this.properties Element.tabIndex = 0;43 this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);42 this.propertiesTreeOutline = new TreeOutline(this.propertiesElement, true); 43 this.propertiesTreeOutline.setFocusable(false); 44 44 this.propertiesTreeOutline.section = this; 45 45 -
trunk/Source/WebCore/inspector/front-end/Spectrum.js
r108734 r109348 39 39 this._containerElement = document.createElement('div'); 40 40 this._containerElement.className = "spectrum-container"; 41 this._containerElement.tabIndex = 0; 42 this._containerElement.addEventListener("keydown", this._onKeyDown.bind(this), false); 41 43 42 44 var topElement = this._containerElement.createChild("div", "spectrum-top"); … … 406 408 reposition: function(element) 407 409 { 410 if (!this._previousFocusElement) 411 this._previousFocusElement = WebInspector.currentFocusElement(); 408 412 this._popover.show(this._containerElement, element); 413 WebInspector.markBeingEdited(this._containerElement, true); 414 WebInspector.setCurrentFocusElement(this._containerElement); 409 415 }, 410 416 411 417 hide: function() 412 418 { 419 WebInspector.markBeingEdited(this._containerElement, false); 413 420 this._popover.hide(); 414 421 … … 418 425 this.dispatchEventToListeners(WebInspector.Spectrum.Events.Hidden); 419 426 427 WebInspector.setCurrentFocusElement(this._previousFocusElement); 428 delete this._previousFocusElement; 429 420 430 delete this.anchorElement; 421 } 422 }; 431 }, 432 433 _onKeyDown: function(event) 434 { 435 if (event.keyIdentifier === "Enter" || event.keyIdentifier === "U+001B") { // Escape key 436 this.hide(); 437 event.stopPropagation(); 438 event.preventDefault(); 439 } 440 } 441 } 423 442 424 443 WebInspector.Spectrum.prototype.__proto__ = WebInspector.Object.prototype; -
trunk/Source/WebCore/inspector/front-end/treeoutline.js
r107933 r109348 29 29 /** 30 30 * @constructor 31 * @param {boolean=} nonFocusable 31 32 */ 32 function TreeOutline(listNode )33 function TreeOutline(listNode, nonFocusable) 33 34 { 34 35 /** … … 49 50 this.searchInputElement = null; 50 51 51 this. _childrenListNode.tabIndex = 0;52 this.setFocusable(!nonFocusable); 52 53 this._childrenListNode.addEventListener("keydown", this._treeKeyDown.bind(this), true); 53 54 this._childrenListNode.addEventListener("keypress", this._treeKeyPress.bind(this), true); … … 55 56 this._treeElementsMap = new Map(); 56 57 this._expandedStateMap = new Map(); 58 } 59 60 TreeOutline.prototype.setFocusable = function(focusable) 61 { 62 if (focusable) 63 this._childrenListNode.setAttribute("tabIndex", 0); 64 else 65 this._childrenListNode.removeAttribute("tabIndex"); 57 66 } 58 67
Note:
See TracChangeset
for help on using the changeset viewer.