mw.widgets.TitleWidget: Use the Promise for the data as well
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 24 Mar 2016 20:00:45 +0000 (20:00 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 24 Mar 2016 20:00:45 +0000 (20:00 +0000)
commit329d89d96881835630ec7956fc5c662beb4d7ee0
tree5f5c1143d86507cc9fa756abce56bd4b1dde75cb
parenta8eba66535b66632f22e96df443c1fc977a17a1a
mw.widgets.TitleWidget: Use the Promise for the data as well

Follows-up a8eba66. Use the Promise for the data as well instead of
just as a callback to evaluate a static variable. This removes any
risk of race conditions or other misuse of the variable.

Also simplify the array creation by using map instead of pushing
in an each loop.

Change-Id: Ide1489a5139ef3b26cf0de6ca6f2e675ef32c724
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js