mediawiki.toc: Clean up left overs
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 6 May 2014 23:29:37 +0000 (01:29 +0200)
committerOri.livneh <ori@wikimedia.org>
Wed, 7 May 2014 07:40:19 +0000 (07:40 +0000)
commit29a12bec58aa4f04f3f49973e45d16156289934a
treeadb2d9d1f465692bc6778691c897eee53109c581
parent26fcab1f18c568a41bf4b25d86067434593a87cb
mediawiki.toc: Clean up left overs

Follows-up d7a40c8 which creates the mediawiki.toc module and
moved the tocToggle method from mediawiki.util.

The tocToggle callback used to be a public method and therefore
had two things about that that are obsolete:

* Taking the toggle as parameter.
  This is a private method now, and we already have a reference
  to the toggle.

* Asserting that the #toc has an <ul>.
  There is no need to defer this check this far in, nor to repeat
  it on each click. The old code checked it earlier was well, but
  we used to repeat the check here as the method was public.
  Now that it is a private helper method we can simply return
  early before setting it all up in the first place.

Also:

* Removed jsduck-like construction. This file is being indexed,
  as part of src/mediawiki/, but turning this into a class seems
  odd. It doesn't really have any structure to it.
  It's just UI glue. Turned it into an ignored file (no doc blocks).

Change-Id: I21d4f735032b96f00291502e06d9d35a74648143
resources/src/mediawiki/mediawiki.toc.js