Skip to content

Commit f7328c6

Browse files
committed
Always scroll content to left hand side.
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
1 parent f38c032 commit f7328c6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

template/app/view/Scrolling.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Ext.define('Docs.view.Scrolling', {
6868
opts = opts || {};
6969
if (el) {
7070
this.setScrollTop(this.getScrollTop() + el.getY() + (opts.offset || 0));
71+
this.setScrollLeft(0);
7172
opts.highlight && el.highlight();
7273
}
7374
},
@@ -88,6 +89,14 @@ Ext.define('Docs.view.Scrolling', {
8889
return this.getScrollEl().scrollTo('top', offset);
8990
},
9091

92+
/**
93+
* Scrolls vertically to given offset.
94+
* @param {Number} offset
95+
*/
96+
setScrollLeft: function(offset) {
97+
return this.getScrollEl().scrollTo('left', offset);
98+
},
99+
91100
/**
92101
* Scrolls panel to the top
93102
*/

0 commit comments

Comments
 (0)