Commit be6918f9 authored by Akikonata's avatar Akikonata

added event step

parent 211403ac
...@@ -90,7 +90,8 @@ KityMinder.registerModule( "IconModule", function () { ...@@ -90,7 +90,8 @@ KityMinder.registerModule( "IconModule", function () {
"progress": setProgressCommand "progress": setProgressCommand
}, },
"events": { "events": {
"RenderNode": function ( e ) { "RenderNodeLeft": function ( e ) {
//alert( '1111111' );
var node = e.node; var node = e.node;
var iconRc = node.getIconRc(); var iconRc = node.getIconRc();
var contRc = node.getContRc(); var contRc = node.getContRc();
......
...@@ -348,21 +348,50 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -348,21 +348,50 @@ KityMinder.registerModule( "LayoutBottom", function () {
default: default:
break; break;
} }
this._fire( new MinderEvent( "beforeRenderNode", { // this._fire( new MinderEvent( "beforeRenderNode", {
// node: node
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: node
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
}, },
updateLayout: function ( node ) { updateLayout: function ( node ) {
this._fire( new MinderEvent( "beforeRenderNode", { // this._fire( new MinderEvent( "beforeRenderNode", {
// node: node
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: node
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
updateShapeByCont( node ); updateShapeByCont( node );
var set = updateLayoutAll( node, node.getParent(), "change" ); var set = updateLayoutAll( node, node.getParent(), "change" );
for ( var i = 0; i < set.length; i++ ) { for ( var i = 0; i < set.length; i++ ) {
...@@ -384,10 +413,19 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -384,10 +413,19 @@ KityMinder.registerModule( "LayoutBottom", function () {
_root.getLayout().align = "center"; _root.getLayout().align = "center";
updateBg( _root ); updateBg( _root );
initLayout( _root ); initLayout( _root );
this._fire( new MinderEvent( "beforeRenderNode", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: _root node: _root
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: _root node: _root
}, false ) ); }, false ) );
updateShapeByCont( _root ); updateShapeByCont( _root );
...@@ -434,10 +472,25 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -434,10 +472,25 @@ KityMinder.registerModule( "LayoutBottom", function () {
//计算位置等流程 //计算位置等流程
updateBg( node ); updateBg( node );
initLayout( node ); initLayout( node );
this._fire( new MinderEvent( "beforeRenderNode", { // this._fire( new MinderEvent( "beforeRenderNode", {
// node: node
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: node
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
updateShapeByCont( node ); updateShapeByCont( node );
......
...@@ -435,18 +435,36 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -435,18 +435,36 @@ KityMinder.registerModule( "LayoutDefault", function () {
default: default:
break; break;
} }
this._fire( new MinderEvent( "beforeRenderNode", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
}, },
updateLayout: function ( node ) { updateLayout: function ( node ) {
this._fire( new MinderEvent( "beforeRenderNode", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
...@@ -468,10 +486,25 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -468,10 +486,25 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root.getLayout().align = "center"; _root.getLayout().align = "center";
updateBg( _root ); updateBg( _root );
initLayout( _root ); initLayout( _root );
this._fire( new MinderEvent( "beforeRenderNode", { // this._fire( new MinderEvent( "beforeRenderNode", {
// node: _root
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: _root
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: _root node: _root
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: _root node: _root
}, false ) ); }, false ) );
updateShapeByCont( _root ); updateShapeByCont( _root );
...@@ -570,10 +603,25 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -570,10 +603,25 @@ KityMinder.registerModule( "LayoutDefault", function () {
//计算位置等流程 //计算位置等流程
updateBg( node ); updateBg( node );
initLayout( node ); initLayout( node );
this._fire( new MinderEvent( "beforeRenderNode", { // this._fire( new MinderEvent( "beforeRenderNode", {
// node: node
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: node
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: node
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: node node: node
}, false ) ); }, false ) );
this._fire( new MinderEvent( "RenderNode", { this._firePharse( new MinderEvent( "RenderNodeTop", {
node: node node: node
}, false ) ); }, false ) );
updateShapeByCont( node ); updateShapeByCont( node );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment