Commit 1cb8fe62 authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

Conflicts:
	import.js
parents 6c6eede3 33e58298
......@@ -10,16 +10,16 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
itemStyles: [],
value: me.getLayoutStyleItems(),
autowidthitem: [],
enabledRecord:false
enabledRecord: false
},
$combox = null;
if ( options.items.length == 0 ) {
return null;
}
utils.each(options.items,function(i,item){
options.items[i] = me.getLang('layout')[item];
});
utils.each( options.items, function ( i, item ) {
options.items[ i ] = me.getLang( 'layout' )[ item ];
} );
//实例化
$combox = $.kmuibuttoncombobox( options ).css( 'zIndex', me.getOptions( 'zIndex' ) + 1 );
var comboboxWidget = $combox.kmui();
......@@ -49,18 +49,18 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
} );
var data = [];
utils.each(me.getLayoutStyleItems(),function(i,v){
data.push({
label:me.getLang( 'tooltips.' + name ) + ' ' + v,
cmdName:'switchlayout',
exec:function(){
me.execCommand('switchlayout',v);
utils.each( me.getLayoutStyleItems(), function ( i, v ) {
data.push( {
label: me.getLang( 'tooltips.' + name ) + ' ' + v,
cmdName: 'switchlayout',
exec: function () {
me.execCommand( 'switchlayout', v );
}
})
});
data.push({
divider:1
});
me.addContextmenu(data);
} )
} );
data.push( {
divider: 1
} );
me.addContextmenu( data );
return comboboxWidget.button().addClass( 'kmui-combobox' );
} );
\ No newline at end of file
......@@ -4,6 +4,7 @@ KM.registerToolbarUI( 'hand zoom-in zoom-out expand contract',
var $btn = $.kmuibutton( {
icon: name,
click: function () {
console.log( name );
me.execCommand( name );
},
title: this.getLang( 'tooltips.' )[ name ] || ''
......
KityMinder.registerModule( "Expand", function () {
var ExpandCommand = kity.createClass( "ExpandCommand", ( function () {
return {
base: Command,
execute: function ( km ) {
km.initStyle( true );
},
queryState: function ( km ) {
return 0;
}
};
} )() );
var ContractCommand = kity.createClass( "ContractCommand", ( function () {
return {
base: Command,
execute: function ( km ) {
km.initStyle();
},
queryState: function ( km ) {
return 0;
}
};
} )() );
return {
'commands': {
'expand': ExpandCommand,
'contract': ContractCommand
}
};
} );
\ No newline at end of file
......@@ -423,7 +423,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( nodeType !== "root" && node.getChildren().length !== 0 ) {
if ( !Layout.shicon ) {
Layout.shicon = new ShIcon( node );
if ( node.getData( 'expand' ) ) {
if ( Layout.expand ) {
Layout.shicon.switchState();
}
}
......@@ -506,7 +506,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
this.highlightNode( node )
}
},
initStyle: function () {
initStyle: function ( expandall ) {
var _root = minder.getRoot();
var historyPoint = _root.getPoint();
if ( historyPoint ) historyPoint = JSON.parse( JSON.stringify( historyPoint ) );
......@@ -553,8 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
return items;
} )();
next = [];
var layer_nolimit = ( expand_layer < 1 ) || false;
var sub_nolimit = ( expandoptions.defaultSubShow < 1 ) || false;
var layer_nolimit = expandall || ( expand_layer < 1 ) || false;
var sub_nolimit = expandall || ( expandoptions.defaultSubShow < 1 ) || false;
var loopcontinue = function () {
return ( layer_nolimit ? ( _buffer.length !== 0 ) : ( _buffer.length !== 0 && cur_layer < expand_layer ) );
};
......@@ -573,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root.setPoint( _root.getLayout().x, _root.getLayout().y );
},
appendChildNode: function ( parent, node, focus, sibling ) {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getData( "expand" ) === false ) {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getLayout().expand === false ) {
minder.expandNode( parent );
}
minder.handelNodeInsert( node );
node.clearLayout();
node.getContRc().clear();
node.setData( 'expand', false );
var Layout = node.getLayout();
Layout.expand = false;
if ( parent.getType() !== 'root' ) {
parent.setData( 'expand', true );
parent.getLayout().expand = true;
}
var Layout = node.getLayout();
Layout.added = true;
var parentLayout = parent.getLayout();
var children = parent.getChildren();
......@@ -739,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
isExpand = ico.icon.switchState();
node = ico.icon._node;
}
node.setData( "expand", isExpand );
var Layout = node.getLayout();
Layout.expand = isExpand;
var _buffer = node.getChildren();
if ( isExpand ) {
for ( var j = 0; j < _buffer.length; j++ ) {
......
......@@ -32,7 +32,7 @@ KityMinder.registerModule( "LayoutModule", function () {
var curStyle = this.getCurrentStyle();
this.getLayoutStyle( curStyle ).highlightNode.call( this, node );
},
initStyle: function () {
initStyle: function ( expandall ) {
var curStyle = this.getCurrentStyle();
this._rc.remove();
this._rc = new kity.Group();
......@@ -42,7 +42,7 @@ KityMinder.registerModule( "LayoutModule", function () {
_root.preTraverse( function ( n ) {
n.clearLayout();
} );
this.getLayoutStyle( curStyle ).initStyle.call( this );
this.getLayoutStyle( curStyle ).initStyle.call( this, expandall );
this.fire( 'afterinitstyle' );
},
appendChildNode: function ( parent, node, focus, index ) {
......@@ -213,9 +213,9 @@ KityMinder.registerModule( "LayoutModule", function () {
return 0;
}
},
isNeedUndo: function () {
return false;
}
isNeedUndo: function () {
return false;
}
};
} )() );
......@@ -246,7 +246,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}.bind( this ), 100 );
},
"import": function ( e ) {
this.initStyle( this.getRoot() );
this.initStyle();
}
},
'contextmenu': [ {
......
themes/default/images/contract.png

1.11 KB | W: | H:

themes/default/images/contract.png

2.93 KB | W: | H:

themes/default/images/contract.png
themes/default/images/contract.png
themes/default/images/contract.png
themes/default/images/contract.png
  • 2-up
  • Swipe
  • Onion skin
themes/default/images/expand.png

3.28 KB | W: | H:

themes/default/images/expand.png

2.98 KB | W: | H:

themes/default/images/expand.png
themes/default/images/expand.png
themes/default/images/expand.png
themes/default/images/expand.png
  • 2-up
  • Swipe
  • Onion skin
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