Commit e08f3cb0 authored by Akikonata's avatar Akikonata

added init

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