提交 1b58746e 编写于 作者: C Catouse

* fix kindeditor dialog not show by calculate position error.

上级 047cf79f
......@@ -87,12 +87,12 @@
function _addUnit(val, unit) {
unit = unit || 'px';
return val && /^\d+$/.test(val) ? val + unit : val;
return val && /^[\d\.]+$/.test(val) ? val + unit : val;
}
function _removeUnit(val) {
var match;
return val && (match = /(\d+)/.exec(val)) ? parseInt(match[1], 10) : 0;
return val && (match = /([\d\.]+)/.exec(val)) ? parseInt(match[1], 10) : 0;
}
function _escape(val) {
......@@ -3730,14 +3730,14 @@
var self = this;
updateProp = _undef(updateProp, true);
if(x !== null) {
x = x < 0 ? 0 : _addUnit(x);
x = x < 0 ? 0 : _addUnit(Math.floor(x));
self.div.css('left', x);
if(updateProp) {
self.x = x;
}
}
if(y !== null) {
y = y < 0 ? 0 : _addUnit(y);
y = y < 0 ? 0 : _addUnit(Math.floor(y));
self.div.css('top', y);
if(updateProp) {
self.y = y;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册