Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/111666
Change subject: Don't chain .then() in this.loading
......................................................................
Don't chain .then() in this.loading
It removes the .abort() method from the promise, even though
we had return jqxhr; in the then() callback.
This fixes a JS error upon calling this.loading.abort();
Change-Id: I50460782e58399198bacc02d028984682ddbed56
---
M modules/ve-mw/init/ve.init.mw.Target.js
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/66/111666/1
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js
b/modules/ve-mw/init/ve.init.mw.Target.js
index 5c246a4..c6b766d 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -785,8 +785,9 @@
// Load DOM
start = ve.now();
- this.loading = this.constructor.static.apiRequest( data )
- .then( function ( data, status, jqxhr ) {
+ this.loading = this.constructor.static.apiRequest( data );
+ // Can't chain .then()/.done()/.fail() because we'd lose the .abort()
method
+ this.loading.then( function ( data, status, jqxhr ) {
ve.track( 'performance.system.domLoad', {
'bytes': $.byteLength( jqxhr.responseText ),
'duration': ve.now() - start,
--
To view, visit https://gerrit.wikimedia.org/r/111666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I50460782e58399198bacc02d028984682ddbed56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits