OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 WebInspector.PropertiesSidebarPane = function() | 29 WebInspector.PropertiesSidebarPane = function() |
30 { | 30 { |
31 WebInspector.SidebarPane.call(this, WebInspector.UIString("Properties")); | 31 WebInspector.SidebarPane.call(this, WebInspector.UIString("Properties")); |
32 } | 32 } |
33 | 33 |
34 WebInspector.PropertiesSidebarPane.prototype = { | 34 WebInspector.PropertiesSidebarPane.prototype = { |
35 update: function(object) | 35 update: function(node) |
36 { | 36 { |
37 var body = this.bodyElement; | 37 var body = this.bodyElement; |
38 | 38 |
39 body.removeChildren(); | 39 body.removeChildren(); |
40 | 40 |
41 this.sections = []; | 41 this.sections = []; |
42 | 42 |
43 if (!object) | 43 if (!node) |
44 return; | 44 return; |
45 | 45 |
46 for (var prototype = object; prototype; prototype = prototype.__proto__)
{ | 46 var self = this; |
47 var section = new WebInspector.ObjectPropertiesSection(prototype); | 47 var callback = function(prototypes) { |
48 this.sections.push(section); | 48 var body = self.bodyElement; |
49 body.appendChild(section.element); | 49 body.removeChildren(); |
50 } | 50 self.sections = []; |
| 51 |
| 52 // Get array of prototype user-friendly names. |
| 53 for (var i = 0; i < prototypes.length; ++i) { |
| 54 var prototype = new WebInspector.ObjectProxy(node.id, [], i); |
| 55 var section = new WebInspector.ObjectPropertiesSection(prototype
, prototypes[i], WebInspector.UIString("Prototype")); |
| 56 self.sections.push(section); |
| 57 body.appendChild(section.element); |
| 58 } |
| 59 }; |
| 60 InspectorController.getPrototypes(node.id, callback); |
51 } | 61 } |
52 } | 62 } |
53 | 63 |
54 WebInspector.PropertiesSidebarPane.prototype.__proto__ = WebInspector.SidebarPan
e.prototype; | 64 WebInspector.PropertiesSidebarPane.prototype.__proto__ = WebInspector.SidebarPan
e.prototype; |
OLD | NEW |