|
@@ -7,15 +7,13 @@ import BaseContainer from '../BaseContainer/index';
|
|
import ImageComp from '../Image/index';
|
|
import ImageComp from '../Image/index';
|
|
import TextComp from '../Text/index';
|
|
import TextComp from '../Text/index';
|
|
|
|
|
|
-import ViewNode from '../../lib/systems/ViewSystem';
|
|
|
|
|
|
+import { ViewNode, Node } from '../../lib/systems/ViewSystem';
|
|
|
|
|
|
-console.log("WHATTTTT")
|
|
|
|
-console.log(BaseContainer.ctor)
|
|
|
|
|
|
+let base1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:320,height:209}))
|
|
|
|
+let base2 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:320,height:209}))
|
|
|
|
+let Image1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Image", {width:320,height:209}))
|
|
|
|
+let Text1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Text", {text:"hi there"}))
|
|
|
|
|
|
-let base1 = new ViewNode(Math.random(), BaseContainer.ctor, {}, {width:320,height:209} , "Base");
|
|
|
|
-let base2 = new ViewNode(Math.random(), BaseContainer.ctor, {}, {width:320,height:209} , "Base2");
|
|
|
|
-let Image1 = new ViewNode(Math.random(), ImageComp.ctor, {}, {width:320,height:209} , "IMg",);
|
|
|
|
-let Text1 = new ViewNode(Math.random(), TextComp.ctor, "anmee" , {} );
|
|
|
|
|
|
|
|
export default class BlogFeed extends Module {
|
|
export default class BlogFeed extends Module {
|
|
|
|
|
|
@@ -30,15 +28,18 @@ export default class BlogFeed extends Module {
|
|
|
|
|
|
configure(){
|
|
configure(){
|
|
if(this.props.CoreSystem){
|
|
if(this.props.CoreSystem){
|
|
- let View = this.props.CoreSystem.getCurrentView();
|
|
|
|
- let node = View.getNode(this.props.NodeID)
|
|
|
|
- if(!View.has(base1)) {
|
|
|
|
- View.addViewNode(base1 , node )
|
|
|
|
- };
|
|
|
|
- if(!View.has(base2.id)) View.addViewNode( base2 ,node);
|
|
|
|
- if(!View.has(Image1.id)) View.addViewNode(Image1,base1)
|
|
|
|
-
|
|
|
|
- if(!View.has(Text1.id)) View.addViewNode(Text1 , base2);
|
|
|
|
|
|
+ let CurrentView = this.props.CoreSystem.getCurrentView();
|
|
|
|
+ let node = CurrentView.getNode(this.props.NodeID)
|
|
|
|
+ let children = CurrentView.getChildren(node);
|
|
|
|
+
|
|
|
|
+ if(!CurrentView.has(base1)) CurrentView.addViewNode(base1 , node );
|
|
|
|
+ if(!CurrentView.has(base2.id)) CurrentView.addViewNode( base2 ,node);
|
|
|
|
+ if(!CurrentView.has(Image1.id)) CurrentView.addViewNode(Image1,base1)
|
|
|
|
+ if(!CurrentView.has(Text1.id)) {
|
|
|
|
+ CurrentView.addViewNode(Text1 , base2);
|
|
|
|
+ this.props.CoreSystem.forceUpdate();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|