OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 _preventFollowingLinksOnDoubleClick: function() | 303 _preventFollowingLinksOnDoubleClick: function() |
304 { | 304 { |
305 var links = this.listItemElement.querySelectorAll("li .webkit-html-tag >
.webkit-html-attribute > .webkit-html-external-link, li .webkit-html-tag > .web
kit-html-attribute > .webkit-html-resource-link"); | 305 var links = this.listItemElement.querySelectorAll("li .webkit-html-tag >
.webkit-html-attribute > .webkit-html-external-link, li .webkit-html-tag > .web
kit-html-attribute > .webkit-html-resource-link"); |
306 if (!links) | 306 if (!links) |
307 return; | 307 return; |
308 | 308 |
309 for (var i = 0; i < links.length; ++i) | 309 for (var i = 0; i < links.length; ++i) |
310 links[i].preventFollowOnDoubleClick = true; | 310 links[i].preventFollowOnDoubleClick = true; |
311 }, | 311 }, |
312 | 312 |
| 313 /** |
| 314 * @override |
| 315 */ |
313 onpopulate: function() | 316 onpopulate: function() |
314 { | 317 { |
315 this.populated = true; | 318 this.populated = true; |
316 this.treeOutline.populateTreeElement(this); | 319 this.treeOutline.populateTreeElement(this); |
317 }, | 320 }, |
318 | 321 |
| 322 /** |
| 323 * @override |
| 324 */ |
319 expandRecursively: function() | 325 expandRecursively: function() |
320 { | 326 { |
321 /** | 327 this._node.getSubtree(-1, TreeElement.prototype.expandRecursively.bind(t
his, Number.MAX_VALUE)); |
322 * @this {WebInspector.ElementsTreeElement} | |
323 */ | |
324 function callback() | |
325 { | |
326 TreeElement.prototype.expandRecursively.call(this, Number.MAX_VALUE)
; | |
327 } | |
328 | |
329 this._node.getSubtree(-1, callback.bind(this)); | |
330 }, | 328 }, |
331 | 329 |
332 /** | 330 /** |
333 * @override | 331 * @override |
334 */ | 332 */ |
335 onexpand: function() | 333 onexpand: function() |
336 { | 334 { |
337 if (this._elementCloseTag) | 335 if (this._elementCloseTag) |
338 return; | 336 return; |
339 | 337 |
340 this.updateTitle(); | 338 this.updateTitle(); |
341 }, | 339 }, |
342 | 340 |
| 341 /** |
| 342 * @override |
| 343 */ |
343 oncollapse: function() | 344 oncollapse: function() |
344 { | 345 { |
345 if (this._elementCloseTag) | 346 if (this._elementCloseTag) |
346 return; | 347 return; |
347 | 348 |
348 this.updateTitle(); | 349 this.updateTitle(); |
349 }, | 350 }, |
350 | 351 |
351 /** | 352 /** |
352 * @override | 353 * @override |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // or create a new attribute on the selected element. | 399 // or create a new attribute on the selected element. |
399 if (this._editing) | 400 if (this._editing) |
400 return false; | 401 return false; |
401 | 402 |
402 this._startEditing(); | 403 this._startEditing(); |
403 | 404 |
404 // prevent a newline from being immediately inserted | 405 // prevent a newline from being immediately inserted |
405 return true; | 406 return true; |
406 }, | 407 }, |
407 | 408 |
| 409 /** |
| 410 * @override |
| 411 */ |
408 selectOnMouseDown: function(event) | 412 selectOnMouseDown: function(event) |
409 { | 413 { |
410 TreeElement.prototype.selectOnMouseDown.call(this, event); | 414 TreeElement.prototype.selectOnMouseDown.call(this, event); |
411 | 415 |
412 if (this._editing) | 416 if (this._editing) |
413 return; | 417 return; |
414 | 418 |
415 // Prevent selecting the nearest word on double click. | 419 // Prevent selecting the nearest word on double click. |
416 if (event.detail >= 2) | 420 if (event.detail >= 2) |
417 event.preventDefault(); | 421 event.preventDefault(); |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 }, | 1639 }, |
1636 | 1640 |
1637 _editAsHTML: function() | 1641 _editAsHTML: function() |
1638 { | 1642 { |
1639 var promise = WebInspector.Revealer.revealPromise(this.node()); | 1643 var promise = WebInspector.Revealer.revealPromise(this.node()); |
1640 promise.then(() => WebInspector.actionRegistry.action("elements.edit-as-
html").execute()); | 1644 promise.then(() => WebInspector.actionRegistry.action("elements.edit-as-
html").execute()); |
1641 }, | 1645 }, |
1642 | 1646 |
1643 __proto__: TreeElement.prototype | 1647 __proto__: TreeElement.prototype |
1644 }; | 1648 }; |
OLD | NEW |