Commit b940c775 authored by campaign's avatar campaign

更新选区

parent e157fb6a
...@@ -4,16 +4,14 @@ ...@@ -4,16 +4,14 @@
###功能更新 ###功能更新
1. 添加保存时可修改文件名 1. 添加保存时可修改文件名
2. 添加超链接功能 2. 添加超链接功能
3. 优化了当输入中文时,中文显示位置与光标距离过远的问题 3. 选中节点时,按F2直接进入文字编辑状态
4. 选中节点时,按F2直接进入文字编辑状态
5. 添加选中节点后可直接输入文字
6. 添加全部展开和部分展开功能
###问题修复 ###问题修复
1. 修复当滚动鼠标滚轮时,光标不跟着移动的问题 1. 修复当滚动鼠标滚轮时,光标不跟着移动的问题
2. 优化了拖拽节点操作体验 2. 优化了拖拽节点操作体验
3. 优化了大文件加载体验 3. 修复回退操作后所选节点未回选问题
4. 修复回退操作后所选节点未回选问题 4. 添加选中节点后可直接输入文字
5. 优化了当输入中文时,中文显示位置与光标距离过远的问题
## v1.1.2 ## v1.1.2
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
$w.kmui().hide(); $w.kmui().hide();
}); });
var url = km.queryCommandValue('hyperlink'); var url = km.queryCommandValue('hyperlink');
var $input = $w.find('#hyperlink_href'); var $input = $w.find('#hyperlink_href');
$input.val(url || 'http://'); $input.val(url || 'http://');
setTimeout(function(){ setTimeout(function(){
......
...@@ -20,7 +20,7 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -20,7 +20,7 @@ KityMinder.registerModule( "TextEditModule", function () {
var selectionByClick = false; var selectionByClick = false;
var dragmoveTimer;
return { return {
"events": { "events": {
//插入光标 //插入光标
...@@ -62,7 +62,7 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -62,7 +62,7 @@ KityMinder.registerModule( "TextEditModule", function () {
.setBaseOffset() .setBaseOffset()
.setContainerStyle() .setContainerStyle()
.setSelectionHeight() .setSelectionHeight()
.setCurrentIndex(e.getPosition()) .setCurrentIndex(e.getPosition(this.getRenderContainer()))
.updateSelection() .updateSelection()
.setRange(range); .setRange(range);
sel.setData('relatedNode',node); sel.setData('relatedNode',node);
...@@ -73,6 +73,7 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -73,6 +73,7 @@ KityMinder.registerModule( "TextEditModule", function () {
selectionByClick = false; selectionByClick = false;
} }
km.setStatus('textedit') km.setStatus('textedit')
lastMousedownTimer = +new Date;
} }
} }
}, },
...@@ -125,6 +126,7 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -125,6 +126,7 @@ KityMinder.registerModule( "TextEditModule", function () {
if(mouseDownStatus){ if(mouseDownStatus){
if(!sel.collapsed ){ if(!sel.collapsed ){
try{ try{
receiver.updateRange(range) receiver.updateRange(range)
}catch(e){ }catch(e){
...@@ -171,10 +173,8 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -171,10 +173,8 @@ KityMinder.registerModule( "TextEditModule", function () {
if(mouseDownStatus){ if(mouseDownStatus){
e.stopPropagationImmediately(); e.stopPropagationImmediately();
var offset = e.getPosition(); var offset = e.getPosition(this.getRenderContainer());
if(Math.abs(offset.y - lastEvtPosition.y) >= 2 && Math.abs(lastEvtPosition.x - offset.x) <= 2 ){
if(Math.abs(offset.y - lastEvtPosition.y) >= 1 && Math.abs(lastEvtPosition.x - offset.x) <= 1 ){
sel.setHide(); sel.setHide();
mouseDownStatus = false; mouseDownStatus = false;
return; return;
......
...@@ -349,7 +349,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -349,7 +349,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
endOffset = this.textData[ this.selection.endOffset ], endOffset = this.textData[ this.selection.endOffset ],
width = 0; width = 0;
if ( this.selection.collapsed ) { if ( this.selection.collapsed ) {
this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ], 0 ); this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ],1 );
return this; return this;
} }
if ( !endOffset ) { if ( !endOffset ) {
......
...@@ -99,7 +99,9 @@ Minder.Selection = kity.createClass( 'Selection', { ...@@ -99,7 +99,9 @@ Minder.Selection = kity.createClass( 'Selection', {
var me = this, var me = this,
state = ''; state = '';
me.setStyle( 'display', '' ); me.setStyle( 'display', '' );
if(this.collapsed){ if(this.collapsed){
me.setOpacity(1);
this.timer = setInterval( function () { this.timer = setInterval( function () {
me.setStyle( 'display', state ); me.setStyle( 'display', state );
state = state ? '' : 'none'; state = state ? '' : 'none';
......
...@@ -29,11 +29,9 @@ KityMinder.registerModule( "hyperlink", function () { ...@@ -29,11 +29,9 @@ KityMinder.registerModule( "hyperlink", function () {
return result; return result;
}, },
queryValue: function ( km ) { queryValue: function ( km ) {
if ( km.queryCommandState( 'hyperlink' ) == 1 ) {
var node = km.getSelectedNode(); var node = km.getSelectedNode();
return node.getData( 'hyperlink' ); return node.getData( 'hyperlink' );
} }
}
} ), } ),
"unhyperlink": kity.createClass( "hyperlink", { "unhyperlink": kity.createClass( "hyperlink", {
base: Command, base: Command,
......
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