summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-06-01 14:37:51 +0800
committerCheng-Han, Wu2016-06-01 14:37:51 +0800
commitf32dee3796777b71333b4020535e789352900b82 (patch)
treebb5d6a800ef563100102e9b1068cbdec0265ee56
parentfb70833bc52aedffa3ed0764a31b706dd1fb3250 (diff)
Remove checkEditorScrollbar workaround since CodeMirror 5.15.3 already fixed this issue, refer to CodeMirror #3896
-rw-r--r--public/js/index.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 4ac1b508..cb3bbcc4 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -795,7 +795,7 @@ function checkEditorStyle() {
if (scrollbarStyle == 'overlay' || currentMode == modeType.both) {
ui.area.codemirrorScroll.css('height', desireHeight + 'px');
ui.area.codemirrorScroll.css('min-height', '');
- checkEditorScrollbar();
+ editor.refresh();
} else if (scrollbarStyle == 'native') {
ui.area.codemirrorScroll.css('height', '');
ui.area.codemirrorScroll.css('min-height', desireHeight + 'px');
@@ -835,7 +835,7 @@ function checkEditorStyle() {
ui.area.view.scroll();
});
}
- checkEditorScrollbar();
+ editor.refresh();
}
});
ui.area.resize.handle = $('.ui-resizable-handle');
@@ -876,14 +876,6 @@ function checkSyncToggle() {
}
}
-function checkEditorScrollbar() {
- // workaround simple scroll bar knob
- // will get wrong position when editor height changed
- var scrollInfo = editor.getScrollInfo();
- editor.scrollTo(null, scrollInfo.top - 1);
- editor.scrollTo(null, scrollInfo.top);
-}
-
function checkTocStyle() {
//toc right
var paddingRight = parseFloat(ui.area.markdown.css('padding-right'));
@@ -2510,7 +2502,7 @@ editor.on('changes', function (cm, changes) {
viewportMargin = newViewportMargin;
windowResize();
}
- checkEditorScrollbar();
+ editor.refresh();
});
editor.on('focus', function (cm) {
for (var i = 0; i < onlineUsers.length; i++) {