Commit f7328c6c authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

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
parent f38c032a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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();
        }
    },
@@ -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
     */