Last modified: 2013-11-23 23:20:20 UTC
Steps to reproduce issue: * MediaWiki + VisualEditor (no Parsoid) * Edit page (dims the page while loading) * Error pops up (parsoidserver-http-curl-error) * Cancel Expected: Page undims. Actual: Page still dimmed.
Caused by I7769bd5a5b79f1ab36f258ef9f2be583ca503ce6. In the refactoring Trevor moved the initialisation of the DOM element for the save/cancel buttons from the ve.init.mw.ViewPageTarget constructor to ve.init.mw.ViewPageTarget#setupToolbarButtons, which isn't called until after a successful load. So, when #load() is called from #activate() and fails a loadError is emitted. onLoadError then calls #deacativate() which calls #tearDownToolbarButtons() But tearDownToolbarButtons is unable to call this.toolbarCancelButton.removeAllListeners because the button doesn't exist yet because setupToolbarButtons was never called.
Change-Id: I91ad2b110c2c523a4bb367407e3f33a953328ab4 That should fix it for now (quick fix). I'm now going to look into how much of this can be refactored to avoid this in the first place. It's all a bit too fragile.