mediawiki.page.gallery: Clean up $galleries variable
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 29 Jan 2015 23:01:06 +0000 (15:01 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 5 Feb 2015 19:52:01 +0000 (11:52 -0800)
commit83d31793d36bc11aa46a6c65154be3eb492fab4c
treeb3bb81f561fd087147d3fc709438f109fac754aa
parent222a8ae1efd9fa096775279c73acd59b77fd7521
mediawiki.page.gallery: Clean up $galleries variable

Follows-up a50c7c4181.

Instead of initialising it to an empty object and executing wasteful
code in the other functions, keep it undefined until it is defined
and use it conditionally.

Also:
* Add comment to justify() documentating what the 'this' context is.
* Return early in resize handle if $galleries hasn't been initialised yet.

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