Commit e08f3cb0 authored by Akikonata's avatar Akikonata

added init

parent 62e12516
...@@ -4,23 +4,24 @@ KityMinder.registerModule( "HistoryModule", function () { ...@@ -4,23 +4,24 @@ KityMinder.registerModule( "HistoryModule", function () {
var Scene = kity.createClass( 'Scene', { var Scene = kity.createClass( 'Scene', {
constructor: function ( root ) { constructor: function ( root ) {
this.data = root.clone(function(node,cloneNode){ this.data = root.clone( function ( node, cloneNode ) {
km.fire('cloneNode',{ km.fire( 'cloneNode', {
'targetNode':cloneNode, 'targetNode': cloneNode,
'sourceNode':node 'sourceNode': node
}) } )
}); } );
}, },
getData: function () { getData: function () {
return this.data; return this.data;
}, },
cloneData: function () { cloneData: function () {
var fn = function(node,cloneNode){ var fn = function ( node, cloneNode ) {
km.fire('cloneNode',{ km.fire( 'cloneNode', {
'targetNode':cloneNode, 'targetNode': cloneNode,
'sourceNode':node 'sourceNode': node
})}; } )
return this.getData().clone(fn); };
return this.getData().clone( fn );
}, },
equals: function ( scene ) { equals: function ( scene ) {
return this.getData().equals( scene.getData() ) return this.getData().equals( scene.getData() )
...@@ -165,10 +166,10 @@ KityMinder.registerModule( "HistoryModule", function () { ...@@ -165,10 +166,10 @@ KityMinder.registerModule( "HistoryModule", function () {
"saveScene": function ( e ) { "saveScene": function ( e ) {
this.historyManager.saveScene(); this.historyManager.saveScene();
}, },
'renderNode':function(e){ 'renderNode': function ( e ) {
var node = e.node; var node = e.node;
if(node.isSelected()){ if ( node.isSelected() ) {
this.select(node) this.select( node )
} }
}, },
"keydown": function ( e ) { "keydown": function ( e ) {
......
...@@ -510,6 +510,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -510,6 +510,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}, },
initStyle: function ( expandall ) { initStyle: function ( expandall ) {
var _root = minder.getRoot(); var _root = minder.getRoot();
debugger;
var historyPoint = _root.getPoint(); var historyPoint = _root.getPoint();
if ( historyPoint ) historyPoint = JSON.parse( JSON.stringify( historyPoint ) ); if ( historyPoint ) historyPoint = JSON.parse( JSON.stringify( historyPoint ) );
minder.handelNodeInsert( _root ); minder.handelNodeInsert( _root );
...@@ -589,6 +590,9 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -589,6 +590,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( Layout ) { if ( Layout ) {
oldExpand = Layout.expand; oldExpand = Layout.expand;
} }
if ( oldExpand ) {
alert( 'aru' );
}
node.clearLayout(); node.clearLayout();
node.getContRc().clear(); node.getContRc().clear();
Layout = node.getLayout(); Layout = node.getLayout();
......
...@@ -247,6 +247,15 @@ KityMinder.registerModule( "LayoutModule", function () { ...@@ -247,6 +247,15 @@ KityMinder.registerModule( "LayoutModule", function () {
}, },
"import": function ( e ) { "import": function ( e ) {
this.initStyle(); this.initStyle();
},
"cloneNode": function ( e ) {
var target = e.targetNode;
var source = e.sourceNode;
target.clearLayout();
var sourceLayout = source.getLayout();
var targetLayout = target.getLayout();
targetLayout.expand = sourceLayout.expand;
console.log( targetLayout );
} }
}, },
'contextmenu': [ { 'contextmenu': [ {
......
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