Commit 8e16d4a9 authored by campaign's avatar campaign

添加换行机制

parent 76ad8d4a
...@@ -266,9 +266,7 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -266,9 +266,7 @@ KityMinder.registerModule('TextEditModule', function() {
}, },
'layoutfinish':function(e){ 'layoutfinish':function(e){
if (e.node === receiver.minderNode && (this.getStatus() == 'textedit' || this.getStatus() == 'inputready') ) {//&& selectionReadyShow if (e.node === receiver.minderNode && (this.getStatus() == 'textedit' || this.getStatus() == 'inputready') ) {//&& selectionReadyShow
receiver receiver.setContainerStyle();
.setBaseOffset()
.setContainerStyle();
} }
}, },
'selectionclear': function() { 'selectionclear': function() {
...@@ -289,7 +287,7 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -289,7 +287,7 @@ KityMinder.registerModule('TextEditModule', function() {
km.setStatus('normal'); km.setStatus('normal');
receiver.clear(); receiver.clear();
}, },
'textedit.mousewheel': function() { 'inputready.mousewheel textedit.mousewheel': function() {
receiver.setContainerStyle(); receiver.setContainerStyle();
} }
......
...@@ -111,10 +111,6 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -111,10 +111,6 @@ Minder.Receiver = kity.createClass('Receiver', {
getBaseOffset: function() { getBaseOffset: function() {
return this.textGroup.getRenderBox('screen'); return this.textGroup.getRenderBox('screen');
}, },
setBaseOffset: function(refer) {
this.baseOffset = this.textGroup.getRenderBox(refer || this.km.getRenderContainer());
return this;
},
setContainerStyle: function() { setContainerStyle: function() {
var textGroupBox = this.getBaseOffset(); var textGroupBox = this.getBaseOffset();
this.container.style.cssText = ';left:' + (browser.ipad ? '-' : '') + this.container.style.cssText = ';left:' + (browser.ipad ? '-' : '') +
...@@ -222,11 +218,6 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -222,11 +218,6 @@ Minder.Receiver = kity.createClass('Receiver', {
this.selection.setHeight((this.minderNode.getData('font-size') || this.minderNode.getStyle('font-size')) * 1); this.selection.setHeight((this.minderNode.getData('font-size') || this.minderNode.getStyle('font-size')) * 1);
return this; return this;
}, },
_getRelativeValue:function(offset){
this.getBaseOffset();
offset.x = offset.x - this.baseOffset.x;
offset.y = offset.y - this.baseOffset.y;
},
updateSelectionByMousePosition: function(offset,dir) { updateSelectionByMousePosition: function(offset,dir) {
var me = this; var me = this;
......
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