ve.init.mw.DesktopArticleTarget: Remove some unnecessary toolbar setup code

This code, added in 703b2c2ed0 (2015),
is no longer necessary.

    // Disconnect the tool factory listeners so the toolbar
    // doesn't start showing new tools as they load, too
    // much flickering
    this.getToolbar().getToolFactory().off( 'register' );

Introduction of targetLoader (d371014e5d)
resulted in all tools already being loaded before a Target is
constructed, so this is definitely not needed.

    // Disable all the tools
    this.getToolbar().updateToolState();

The tools are already disabled because we set the surface to read-only
above, so this does nothing.

Change-Id: Idb162b60891cd1b961e29d2b9f62b74908f17957
This commit is contained in:
Bartosz Dziewoński 2019-02-07 21:04:32 +01:00
parent f1b7225336
commit 92bb0e557a

View file

@ -458,12 +458,6 @@ ve.init.mw.DesktopArticleTarget.prototype.activate = function ( dataPromise ) {
surface.setReadOnly( true );
// setSurface creates dummy toolbar
this.setSurface( surface );
// Disconnect the tool factory listeners so the toolbar
// doesn't start showing new tools as they load, too
// much flickering
this.getToolbar().getToolFactory().off( 'register' );
// Disable all the tools
this.getToolbar().updateToolState();
this.load( dataPromise );
}