Commit 533ef8e4 authored by campaign's avatar campaign

by zhanyi

parent 0de26c44
...@@ -21,17 +21,10 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -21,17 +21,10 @@ Minder.Receiver = kity.createClass('Receiver',{
_div.className = 'km_receiver'; _div.className = 'km_receiver';
this.container = document.body.insertBefore(_div,document.body.firstChild); this.container = document.body.insertBefore(_div,document.body.firstChild);
utils.addCssRule('km_receiver_css',' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}');// utils.addCssRule('km_receiver_css',' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}');//
// utils.listen(_div,'keydown keypress keyup', utils.proxy(this.keyboardEvents,this));
this.km.on('beforekeyup', utils.proxy(this.keyboardEvents,this)); this.km.on('beforekeyup', utils.proxy(this.keyboardEvents,this));
this.timer = null; this.timer = null;
this.index = 0; this.index = 0;
}, },
setPosition : function(textShapeOffset){
this.container.style.top = textShapeOffset.x + 'px';
this.container.style.left = textShapeOffset.y + 'px';
this.textShape.setPosition(textShapeOffset.x,textShapeOffset.y + this.textShape.getSize());
return this;
},
setRange : function(range,index){ setRange : function(range,index){
this.index = index || this.index; this.index = index || this.index;
...@@ -162,10 +155,11 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -162,10 +155,11 @@ Minder.Receiver = kity.createClass('Receiver',{
setContainerStyle : function(){ setContainerStyle : function(){
var textShapeBox = this.textShape.getRenderBox(); var textShapeBox = this.textShape.getRenderBox();
var size = this.textShape.getSize(); var size = this.textShape.getSize();
this.container.style.cssText += ";left:" + this.offset.x
+ 'px;top:' + (this.offset.y + size) this.container.style.cssText = ";left:" + this.offset.x
+ 'px;top:' + (this.offset.y+textShapeBox.height)
+ 'px;width:' + textShapeBox.width + 'px;width:' + textShapeBox.width
+ 'px;height:' + textShapeBox.height + 'px;font-size:' + size + 'px'; + 'px;height:' + textShapeBox.height + 'px;';
return this; return this;
}, },
getTextOffsetData:function(){ getTextOffsetData:function(){
......
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