Fix some metadata panel scrolling/text truncation bugs

* isOpening was calculated too early, so whenever the panel was
  partially open and opened up fully via the forceDirection
  parameter of toggle(), it was logged as the wrong direction.
  (I think the only way for this to happen is via clicking on
  "view terms" while the panel is partially open.)
* scrolling did not go all the way to the bottom when text was
  truncated as the target position was calculated before untruncating.
* panel position was not preserved in some cases where it could have
  been because the attempt to restore it happened before untruncating
  the text, when the panel was not high enough.

Change-Id: I47a96d42c80e0a00d95023526ede3b5bbf18a52c
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/983
Merge "Fix some metadata panel scrolling/text truncation bugs"