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

Simplify the use of Scrolling mixin.

Remove need to call #initScrolling explicitly from all the initComponent
methods of classes that use this mixin.  Instead inject the call into
initComponent of those classes at creation time.
parent ec2d6927
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -5,13 +5,13 @@
 * context, allowing the scroll amount to be restored afterwards.
 */
Ext.define('Docs.view.Scrolling', {
    /**
     * Initializes scroll state saving.
     *
     * Should be called from initComponent of the class that mixes this in.
     *
     * @protected
     */
    // Inject call fo #initScrolling into initComponent into class
    // that uses this mixin
    onClassMixedIn: function(owner) {
        Ext.Function.interceptBefore(owner.prototype, "initComponent", this.prototype.initScrolling);
    },

    // Initializes scroll state saving.
    initScrolling: function() {
        this.scrollContext = 'index';
        this.scrollState = {};
+0 −2
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@ Ext.define('Docs.view.cls.Index', {
            categories: Docs.ContentGrabber.get("categories-content")
        };

        this.initScrolling();

        this.callParent(arguments);
    },

+0 −2
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ Ext.define('Docs.view.cls.Overview', {
            'afterload'
        );

        this.initScrolling();

        this.callParent(arguments);
    },

+0 −5
Original line number Diff line number Diff line
@@ -15,11 +15,6 @@ Ext.define('Docs.view.comments.Index', {
        { xtype: 'container', id: 'recentcomments' }
    ],

    initComponent: function() {
        this.initScrolling();
        this.callParent();
    },

    /**
     * Returns tab config for comments page.
     * @return {Object}
+0 −2
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ Ext.define('Docs.view.examples.Index', {
            })
        ];

        this.initScrolling();

        this.callParent(arguments);
    },

Loading