Skip to content

Commit

Permalink
Always scroll content to left hand side.
Browse files Browse the repository at this point in the history
When navigating to a class member or guide section.

To undo the effect of horizontal scrolling that may have been
done before to view an image that didn't fit in width.

Fixes #411
  • Loading branch information
nene committed Jul 30, 2013
1 parent f38c032 commit f7328c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions template/app/view/Scrolling.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Ext.define('Docs.view.Scrolling', {
opts = opts || {};
if (el) {
this.setScrollTop(this.getScrollTop() + el.getY() + (opts.offset || 0));
this.setScrollLeft(0);
opts.highlight && el.highlight();
}
},
Expand All @@ -88,6 +89,14 @@ Ext.define('Docs.view.Scrolling', {
return this.getScrollEl().scrollTo('top', offset);
},

/**
* Scrolls vertically to given offset.
* @param {Number} offset
*/
setScrollLeft: function(offset) {
return this.getScrollEl().scrollTo('left', offset);
},

/**
* Scrolls panel to the top
*/
Expand Down

0 comments on commit f7328c6

Please sign in to comment.