From 48491a73870a4e4d229c2b8ff6ab462b90aea1ca Mon Sep 17 00:00:00 2001 From: joyqi Date: Wed, 20 Nov 2013 22:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=87=AA=E5=8A=A8=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/editor-js.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/editor-js.php b/admin/editor-js.php index 5b810565..75cbfaf3 100644 --- a/admin/editor-js.php +++ b/admin/editor-js.php @@ -140,9 +140,10 @@ $(document).ready(function () { var diff = $('.diff', preview); if (diff.length > 0) { - var p = diff.position(); + var p = diff.position(), lh = diff.parent().css('line-height'); + lh = !!lh ? parseInt(lh) : 0; - if (p.top < 0 || p.top > preview.height()) { + if (p.top < 0 || p.top > preview.height() - lh) { preview.scrollTo(diff, { offset : - 50 });