Commit 91b21a7c authored by Akikonata's avatar Akikonata

added collapse

parent 2b12ff28
...@@ -86,7 +86,7 @@ KityMinder.registerModule( "Expand", function () { ...@@ -86,7 +86,7 @@ KityMinder.registerModule( "Expand", function () {
*/ */
collapse: function ( policy ) { collapse: function ( policy ) {
policy = policy || EXPAND_POLICY.KEEP_STATE; policy = policy || EXPAND_POLICY.KEEP_STATE;
policy( this, STATE_EXPAND, policy ); policy( this, STATE_COLLAPSE, policy );
return this; return this;
}, },
......
...@@ -34,7 +34,9 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -34,7 +34,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
iconShape.addShapes( [ circle, plus, dec ] ); iconShape.addShapes( [ circle, plus, dec ] );
this.update(); this.update();
}, },
switchState: function () { switchState: function ( val ) {
if ( val === true || val === false )
this._show = !val;
if ( !this._show ) { if ( !this._show ) {
this._plus.setOpacity( 0 ); this._plus.setOpacity( 0 );
this._dec.setOpacity( 1 ); this._dec.setOpacity( 1 );
...@@ -567,6 +569,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -567,6 +569,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
while ( _buffer.length !== 0 ) { while ( _buffer.length !== 0 ) {
var c = _buffer[ 0 ].getChildren(); var c = _buffer[ 0 ].getChildren();
if ( _buffer[ 0 ].isExpanded() && c.length !== 0 ) { if ( _buffer[ 0 ].isExpanded() && c.length !== 0 ) {
_buffer[ 0 ].getLayout().shicon.switchState( true );
for ( var x = 0; x < c.length; x++ ) { for ( var x = 0; x < c.length; x++ ) {
minder.appendChildNode( _buffer[ 0 ], c[ x ] ); minder.appendChildNode( _buffer[ 0 ], c[ x ] );
} }
......
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