Changeset 21007 in webkit
- Timestamp:
- Apr 22, 2007, 3:12:00 PM (18 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r21006 r21007 1 2007-04-22 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Mitz. 4 5 Bug 13436: Make Option-clicking a disclosure triangle expand the entire subtree 6 http://bugs.webkit.org/show_bug.cgi?id=13436 7 8 Makes option-click recursively expand and collapse the sub-tree. Pressing option-left 9 and -right also recursively expands and collapses the sub-tree. 10 11 * WebInspector/webInspector/treeoutline.js: 12 1 13 2007-04-22 Timothy Hatcher <timothy@apple.com> 2 14 -
trunk/WebKit/WebInspector/webInspector/treeoutline.js
r20986 r21007 188 188 TreeOutline.prototype.handleKeyEvent = function(event) 189 189 { 190 if (!this.selectedTreeElement || event.shiftKey || event.metaKey || event. altKey || event.ctrlKey)190 if (!this.selectedTreeElement || event.shiftKey || event.metaKey || event.ctrlKey) 191 191 return; 192 192 193 193 var handled = false; 194 194 var nextSelectedElement; 195 if (event.keyIdentifier === "Up" ) {195 if (event.keyIdentifier === "Up" && !event.altKey) { 196 196 nextSelectedElement = this.selectedTreeElement.traversePreviousTreeElement(true); 197 197 handled = true; 198 } else if (event.keyIdentifier === "Down" ) {198 } else if (event.keyIdentifier === "Down" && !event.altKey) { 199 199 nextSelectedElement = this.selectedTreeElement.traverseNextTreeElement(true); 200 200 handled = true; 201 201 } else if (event.keyIdentifier === "Left") { 202 202 if (this.selectedTreeElement.expanded) { 203 this.selectedTreeElement.collapse(); 203 if (event.altKey) 204 this.selectedTreeElement.collapseRecursively(); 205 else 206 this.selectedTreeElement.collapse(); 204 207 handled = true; 205 208 } else if (this.selectedTreeElement.parent && !this.selectedTreeElement.parent.root) { … … 209 212 } else if (event.keyIdentifier === "Right") { 210 213 if (this.selectedTreeElement.hasChildren) { 211 this.selectedTreeElement.expand(); 214 if (event.altKey) 215 this.selectedTreeElement.expandRecursively(); 216 else 217 this.selectedTreeElement.expand(); 212 218 handled = true; 213 219 } … … 347 353 if (event.offsetX <= 20 && element.treeElement.hasChildren) { 348 354 if (element.treeElement.expanded) { 349 element.treeElement.collapse(); 355 if (event.altKey) 356 element.treeElement.collapseRecursively(); 357 else 358 element.treeElement.collapse(); 350 359 } else { 351 element.treeElement.expand(); 360 if (event.altKey) 361 element.treeElement.expandRecursively(); 362 else 363 element.treeElement.expand(); 352 364 } 353 365 } … … 382 394 } 383 395 396 TreeElement.prototype.collapseRecursively = function() 397 { 398 var item = this; 399 while (item) { 400 if (item.expanded) 401 item.collapse(); 402 item = item.traverseNextTreeElement(false, this, true); 403 } 404 } 405 384 406 TreeElement.prototype.expand = function() 385 407 { … … 423 445 if (this.onexpand) 424 446 this.onexpand(this); 447 } 448 449 TreeElement.prototype.expandRecursively = function() 450 { 451 var item = this; 452 while (item) { 453 item.expand(); 454 item = item.traverseNextTreeElement(false, this); 455 } 425 456 } 426 457
Note:
See TracChangeset
for help on using the changeset viewer.