mediawiki.page.gallery.slideshow: Avoid manual Deferred wrapping
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 6 Aug 2019 13:00:17 +0000 (14:00 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 6 Aug 2019 13:03:48 +0000 (14:03 +0100)
commite4166ca60989e7752382e012c1b4f86a12b068a4
tree993f7c1ee1dc72420f874bd466ce34963a6034ef
parent774d8c0bc85460c961210a7ffca6a29de481c921
mediawiki.page.gallery.slideshow: Avoid manual Deferred wrapping

* Use then(), which automatically forwards errors, instead of manually
  forwarding fail() to d.reject(). This also ensures that any
  errors in the done() or fail() handler themselves are caught and reject
  the returned Deferred – instead of an causing the Deferred to indefinely
  be in the "pending" state.

* Use then(), which makes the code consistently asynchronous,
  instead of sometimes sync and sometimes async.

* Use then() for forward-compat with native ES6 Promise.

Change-Id: I58fb6ec23fb4056fe2bbb146ff4225dea9d9f379
resources/src/mediawiki.page.gallery.slideshow.js