Authored by ZhongW

取消编辑器内部滚动,导致换行

... ... @@ -3217,16 +3217,15 @@ var jQuery = require('jquery');
scrollIntoView: function() {
var $span = $('<span style="padding:0;margin:0;display:block;border:0">&nbsp;</span>');
this.cloneRange().insertNode($span.get(0));
var winScrollTop = $(this.body.id).scrollTop(),
winHeight = $(this.body.id).height(),
spanTop = $span.offset().top;
var winScrollTop = $("#"+this.body.id).scrollTop(),
winHeight = $("#"+this.body.id).height(),
spanTop = $span.offset().top;
if (spanTop < winScrollTop - winHeight || spanTop > winScrollTop + winHeight) {
if (spanTop > winScrollTop + winHeight) {
this.body.id.scrollTo(0, spanTop - winHeight + $span.height())
} else {
this.body.id.scrollTo(0, winScrollTop - spanTop)
}
// if (spanTop > winScrollTop + winHeight) {
// window.scrollTo(0, spanTop - winHeight + $span.height())
// } else {
// window.scrollTo(0, winScrollTop - spanTop)
// }
}
$span.remove();
},
... ...