提交 227f7597 编写于 作者: C Catouse

* fix kindeditor bug in ie11.

上级 2282b677
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
var _VERSION = '4.1.9 (2013-10-08)', var _VERSION = '4.1.9 (2013-10-08)',
_ua = navigator.userAgent.toLowerCase(), _ua = navigator.userAgent.toLowerCase(),
_IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1, _IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1,
_NEWIE = _ua.indexOf('msie') == -1 && _ua.indexOf('trident') > -1,
_GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1, _GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1,
_WEBKIT = _ua.indexOf('applewebkit') > -1, _WEBKIT = _ua.indexOf('applewebkit') > -1,
_OPERA = _ua.indexOf('opera') > -1, _OPERA = _ua.indexOf('opera') > -1,
...@@ -1368,17 +1369,14 @@ ...@@ -1368,17 +1369,14 @@
function _getScrollPos(doc) { function _getScrollPos(doc) {
doc = doc || document; doc = doc || document;
var x, y; var x, y;
if(_IE || _OPERA) { if (_IE || _NEWIE || _OPERA) {
x = _docElement(doc).scrollLeft; x = _docElement(doc).scrollLeft;
y = _docElement(doc).scrollTop; y = _docElement(doc).scrollTop;
} else { } else {
x = _getWin(doc).scrollX; x = _getWin(doc).scrollX;
y = _getWin(doc).scrollY; y = _getWin(doc).scrollY;
} }
return { return {x : x, y : y};
x: x,
y: y
};
} }
function KNode(node) { function KNode(node) {
...@@ -3724,10 +3722,10 @@ ...@@ -3724,10 +3722,10 @@
}, },
autoPos: function(width, height) { autoPos: function(width, height) {
var self = this, var self = this,
w = _removeUnit(width) || 0, w = _removeUnit(width) || 0,
h = _removeUnit(height) || 0, h = _removeUnit(height) || 0,
scrollPos = _getScrollPos(); scrollPos = _getScrollPos();
if(self._alignEl) { if (self._alignEl) {
var knode = K(self._alignEl), var knode = K(self._alignEl),
pos = knode.pos(), pos = knode.pos(),
diffX = _round(knode[0].clientWidth / 2 - w / 2), diffX = _round(knode[0].clientWidth / 2 - w / 2),
...@@ -3739,7 +3737,7 @@ ...@@ -3739,7 +3737,7 @@
x = _round(scrollPos.x + (docEl.clientWidth - w) / 2); x = _round(scrollPos.x + (docEl.clientWidth - w) / 2);
y = _round(scrollPos.y + (docEl.clientHeight - h) / 2); y = _round(scrollPos.y + (docEl.clientHeight - h) / 2);
} }
if(!(_IE && _V < 7 || _QUIRKS)) { if (!(_IE && _V < 7 || _QUIRKS)) {
x -= scrollPos.x; x -= scrollPos.x;
y -= scrollPos.y; y -= scrollPos.y;
} }
...@@ -6215,6 +6213,8 @@ ...@@ -6215,6 +6213,8 @@
} else { } else {
cmd.range.selectNodeContents(div[0]); cmd.range.selectNodeContents(div[0]);
cmd.select(); cmd.select();
div[0].tabIndex = -1;
div[0].focus();
} }
setTimeout(function() { setTimeout(function() {
movePastedData(); movePastedData();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册