Permalink
Browse files

Keep the scroll position when the focus mode turn off

  • Loading branch information...
1 parent f084b5e commit e9bfca17d9228bf348215c172c1e9f4f7563f36f @icebeat committed Nov 17, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 js/commands.js
View
@@ -723,8 +723,10 @@ Extend(Editor.prototype, {
if (this.focusmode) {
this.focusmode = null;
this.onMouseWheel();
+ var offsetTop = parseInt(wrapper.style.paddingTop) - line_height;
wrapper.style.padding = line_height + "px 0";
- view.scrollTop = this.selectionStart().y;
+ view.scrollTop = this.selectionStart().y - offsetTop;
+
} else {
this.focusmode = true;
this.editor.classList.add("focusmode");

0 comments on commit e9bfca1

Please sign in to comment.