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

Forget scroll position after tab closed.

Re-implement the old behavior.
parent 682c3014
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -135,6 +135,12 @@ Ext.define('Docs.controller.Classes', {
                        delegate: '.x-resizable-handle'
                    });
                }
            },

            'doctabs': {
                tabClose: function(url) {
                    this.getOverview().eraseScrollContext(url);
                }
            }
        });
    },
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,11 @@ Ext.define('Docs.controller.Guides', {
                        delegate: '.guide'
                    });
                }
            },
            'doctabs': {
                tabClose: function(url) {
                    this.getGuide().eraseScrollContext(url);
                }
            }
        });
    },
+0 −3
Original line number Diff line number Diff line
@@ -94,9 +94,6 @@ Ext.define('Docs.controller.Tabs', {

        this.control({
            '[componentCls=doctabs]': {
                tabClose: function(url) {
                    // delete this.scrollState[url];
                },
                tabActivate: function(url, opts) {
                    Docs.History.push(url, opts);
                },
+9 −0
Original line number Diff line number Diff line
@@ -30,6 +30,15 @@ Ext.define('Docs.view.Scrolling', {
        this.scrollContext = ctx;
    },

    /**
     * Erases data about the given scrolling context.
     *
     * @param {String} ctx A name for the context.
     */
    eraseScrollContext: function(ctx) {
        delete this.scrollState[ctx];
    },

    /**
     * Saves the scroll state in current context.
     *