Commit 57e57bb5 authored by techird's avatar techird

dist

parent fb2f1551
...@@ -533,7 +533,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -533,7 +533,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
node.parent.removeChild( node ); node.parent.removeChild( node );
} }
node.parent = this; node.parent = this;
node.root = parent.root; node.root = node.parent.root;
this.children.splice( index, 0, node ); this.children.splice( index, 0, node );
}, },
...@@ -3204,9 +3204,11 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -3204,9 +3204,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
Layout.connect = null; Layout.connect = null;
Layout.shicon = null; Layout.shicon = null;
} else { } else {
_buffer[ 0 ].getRenderContainer().remove(); try {
Layout.connect.remove(); _buffer[ 0 ].getRenderContainer().remove();
if ( Layout.shicon ) Layout.shicon.remove(); Layout.connect.remove();
if ( Layout.shicon ) Layout.shicon.remove();
} catch ( error ) {}
} }
_buffer = _buffer.concat( _buffer[ 0 ].getChildren() ); _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
_buffer.shift(); _buffer.shift();
...@@ -3355,6 +3357,9 @@ var ViewDragger = kity.createClass( "ViewDragger", { ...@@ -3355,6 +3357,9 @@ var ViewDragger = kity.createClass( "ViewDragger", {
paper.setStyle( 'cursor', value ? '-webkit-grab' : 'default' ); paper.setStyle( 'cursor', value ? '-webkit-grab' : 'default' );
this._enabled = value; this._enabled = value;
}, },
move: function ( offset ) {
this._minder.getRenderContainer().translate( offset.x, offset.y );
},
_bind: function () { _bind: function () {
var dragger = this, var dragger = this,
...@@ -3371,7 +3376,7 @@ var ViewDragger = kity.createClass( "ViewDragger", { ...@@ -3371,7 +3376,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
} }
// 点击未选中的根节点临时开启 // 点击未选中的根节点临时开启
else if ( e.getTargetNode() == this.getRoot() && else if ( e.getTargetNode() == this.getRoot() &&
(!this.getRoot().isSelected() || !this.isSingleSelect())) { ( !this.getRoot().isSelected() || !this.isSingleSelect() ) ) {
lastPosition = e.getPosition(); lastPosition = e.getPosition();
dragger.setEnabled( true ); dragger.setEnabled( true );
isRootDrag = true; isRootDrag = true;
...@@ -3385,8 +3390,7 @@ var ViewDragger = kity.createClass( "ViewDragger", { ...@@ -3385,8 +3390,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
// 当前偏移加上历史偏移 // 当前偏移加上历史偏移
var offset = kity.Vector.fromPoints( lastPosition, currentPosition ); var offset = kity.Vector.fromPoints( lastPosition, currentPosition );
dragger.move( offset );
this.getRenderContainer().translate( offset.x, offset.y );
e.stopPropagation(); e.stopPropagation();
lastPosition = currentPosition; lastPosition = currentPosition;
} }
...@@ -3428,6 +3432,23 @@ KityMinder.registerModule( 'Hand', function () { ...@@ -3428,6 +3432,23 @@ KityMinder.registerModule( 'Hand', function () {
this.execCommand( 'hand' ); this.execCommand( 'hand' );
e.preventDefault(); e.preventDefault();
} }
},
mousewheel: function ( e ) {
var dx = e.originEvent.wheelDeltaX || e.originEvent.wheelDelta,
dy = e.originEvent.wheelDeltaY || 0;
this._viewDragger.move( {
x: dx / 2.5,
y: dy / 2.5
} );
e.originEvent.preventDefault();
},
dblclick: function() {
var viewport = this.getPaper().getViewPort();
var offset = this.getRoot().getRenderContainer(this.getRenderContainer()).getTransform().getTranslate();
var dx = viewport.center.x - offset.x,
dy = viewport.center.y - offset.y;
this.getRenderContainer().fxTranslate(dx, dy, 300);
} }
} }
}; };
...@@ -4528,7 +4549,7 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -4528,7 +4549,7 @@ Minder.Receiver = kity.createClass('Receiver',{
return; return;
} }
var text = (this.container.textContent || this.container.innerText).replace(/\u200b/g,''); var text = this.container.textContent.replace(/\u200b/g,'');
if(this.textShape.getOpacity() == 0){ if(this.textShape.getOpacity() == 0){
this.textShape.setOpacity(1); this.textShape.setOpacity(1);
......
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