-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdebug.coffee
36 lines (25 loc) · 1.16 KB
/
debug.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class BlazeComponentDebug extends BaseComponentDebug
@startComponent: (component) ->
super arguments...
console.log component.data()
@startMarkedComponent: (component) ->
super arguments...
console.log component.data()
@dumpComponentSubtree: (rootComponentOrElement) ->
if 'nodeType' of rootComponentOrElement and rootComponentOrElement.nodeType is Node.ELEMENT_NODE
rootComponentOrElement = BlazeComponent.getComponentForElement rootComponentOrElement
super arguments...
@dumpComponentTree: (rootComponentOrElement) ->
if 'nodeType' of rootComponentOrElement and rootComponentOrElement.nodeType is Node.ELEMENT_NODE
rootComponentOrElement = BlazeComponent.getComponentForElement rootComponentOrElement
super arguments...
@dumpAllComponents: ->
allRootComponents = []
$('*').each (i, element) =>
component = BlazeComponent.getComponentForElement element
return unless component
rootComponent = @componentRoot component
allRootComponents.push rootComponent unless rootComponent in allRootComponents
for rootComponent in allRootComponents
@dumpComponentSubtree rootComponent
return