Commit 4bb6399b authored by techird's avatar techird

Merge branch 'dev' of github.com:fex-team/kityminder into dev

parents a5cb96ee 0a733593
......@@ -7,26 +7,26 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<script src="lib/jquery-2.1.0.min.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/jquery-2.1.0.min.js?_=1399624214062" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1399624214062" charset="utf-8"></script>
<script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script>
<script src="lib/kitygraph.all.min.js?_=1399615757955" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399615757955" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399615757955" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/kitygraph.all.min.js?_=1399624214062" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399624214062" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399624214062" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1399624214062" charset="utf-8"></script>
<script src="lib/zip.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/zip.js?_=1399624214062" charset="utf-8"></script>
<script>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399615757955" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399615757955" charset="utf-8"></script>
<script src="social/social.js?_=1399615757955" charset="utf-8"></script>
<script src="lib/jquery.xml2json.js?_=1399624214062" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399624214062" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399624214062" charset="utf-8"></script>
<script src="social/social.js?_=1399624214062" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
......
......@@ -2915,7 +2915,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
for ( var i = 0; i < children.length; i++ ) {
var childLayout = children[ i ].getLayout();
if ( children[ i ].getRenderContainer().getHeight() !== 0 )
if ( children[ i ].getRenderContainer().getPaper() && children[ i ].getRenderContainer().getHeight() !== 0 )
sum += childLayout.branchheight;
}
return sum;
......@@ -5619,17 +5619,25 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
setContainerStyle: function () {
var textShapeBox = this.getBaseOffset('screen');
var me = this;
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 5 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
var paperContainer = this.km.getPaper();
var width = paperContainer.getWidth();
var height = paperContainer.getHeight();
var containerWidth = this.container.offsetWidth;
if(width < containerWidth + this.container.offsetLeft){
this.km.getRenderContainer().fxTranslate(width/-2, 0, 200, "ease", 0, function() {
me.setContainerStyle()
});
if(!this.selection.isShow()){
var paperContainer = this.km.getPaper();
var width = paperContainer.node.parentNode.clientWidth;
var height = paperContainer.node.parentNode.clientHeight;
if(width < this.container.offsetWidth + this.container.offsetLeft){
this.km.getRenderContainer().translate(width/-3, 0);
this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){
this.km.getRenderContainer().translate(0, height/-3);
this.setContainerStyle()
}
}
return this;
},
getTextOffsetData: function () {
......@@ -5718,7 +5726,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me.selection.setEndOffset( i + 1 )
} else {
if ( dir == 1 ) {
me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 ? 1 : 0 ) );
me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 && i < me.textData.length - 1 ? 1 : 0 ) );
} else {
me.selection.setStartOffset( i );
}
......@@ -5740,8 +5748,13 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this;
}
if ( !endOffset ) {
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
try{
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){
console.log(e)
}
} else {
width = endOffset.x - startOffset.x;
}
......@@ -5782,6 +5795,7 @@ Minder.Selection = kity.createClass( 'Selection', {
this.startOffset = this.endOffset = 0;
this.setOpacity(0.5);
this.setStyle('cursor','text');
this._show = false;
},
collapse : function(toEnd){
......@@ -5855,11 +5869,13 @@ Minder.Selection = kity.createClass( 'Selection', {
setHide: function () {
clearInterval( this.timer );
this.setStyle( 'display', 'none' );
this._show = false;
return this;
},
setShowHold: function () {
clearInterval( this.timer );
this.setStyle( 'display', '' );
this._show = true;
return this;
},
setShow: function () {
......@@ -5867,7 +5883,7 @@ Minder.Selection = kity.createClass( 'Selection', {
var me = this,
state = '';
me.setStyle( 'display', '' );
me._show = true;
if(this.collapsed){
me.setOpacity(1);
this.timer = setInterval( function () {
......@@ -5878,6 +5894,9 @@ Minder.Selection = kity.createClass( 'Selection', {
return this;
},
isShow:function(){
return this._show;
},
setTextShape: function ( text ) {
if ( !text ) {
this.text = new kity.Text();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -246,9 +246,9 @@ var utils = Utils = KityMinder.Utils = {
element.onload = element.onreadystatechange = null;
}
};
element.onerror = function () {
throw Error('The load ' + (obj.href || obj.src) + ' fails,check the url settings of file ')
};
// element.onerror = function () {
// throw Error('The load ' + (obj.href || obj.src) + ' fails,check the url settings of file ')
// };
doc.getElementsByTagName("head")[0].appendChild(element);
}
}(),
......
......@@ -19,7 +19,7 @@ Minder.Range = kity.createClass('Range',{
try{
this.nativeRange.setStart(node,index);
}catch(e){
console.log(e)
console.log('e')
}
return this;
......
......@@ -250,12 +250,12 @@ Minder.Receiver = kity.createClass( 'Receiver', {
if(width < this.container.offsetWidth + this.container.offsetLeft){
this.km.getRenderContainer().translate(width/-3, 0);
//this.setContainerStyle();
console.log(width, this.container.offsetWidth + this.container.offsetLeft);
this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){
this.km.getRenderContainer().translate(0, height/-3);
//this.setContainerStyle()
this.setContainerStyle()
}
}
......@@ -340,7 +340,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
if ( offset.x <= v.x + v.width / 2 ) {
me.selection.collapse()
} else {
me.selection.setEndOffset( i + ( me.selection.endOffset > i || dir == 1 ? 1 : 0 ) )
me.selection.setEndOffset( i + ( ( me.selection.endOffset > i || dir == 1 ) && i != me.textData.length - 1 ? 1 : 0 ) )
}
} else if ( i > me.index ) {
......@@ -348,7 +348,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me.selection.setEndOffset( i + 1 )
} else {
if ( dir == 1 ) {
me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 ? 1 : 0 ) );
me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 && i != me.textData.length - 1 ? 1 : 0 ) );
} else {
me.selection.setStartOffset( i );
}
......@@ -370,8 +370,13 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this;
}
if ( !endOffset ) {
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
try{
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){
console.log('e')
}
} else {
width = endOffset.x - startOffset.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