Commit 91b21a7c authored by Akikonata's avatar Akikonata

added collapse

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