mediawiki-extensions-Popups/src/ui/templates
Stephen Niedzielski 2eeaa0a2e4 Hygiene: consolidate clip-path manipulation
The clip-path SVG property was conditionally set in thumbnail.js and
also conditionally set or removed in renderer.js. This patch refactors
the logic to occur in a single place, renderer.js.

The refactor was made with the following considerations:

• The one condition under which thumbnail.js would set clip-path was,
  given a thumbnail exists, the thumbnail was not tall and clip-path
  would be set to `url(#mwe-popups-mask)`. Otherwise, thumbnail.js would
  not set clip-path.

• The logic in renderer.js for setting the attribute doesn't change
  since overwriting the clip-path is equivalent to not having a
  preexisting value. The case for removing the attribute itself is
  replaced by inverting the condition, `flippedY`, and combining it with
  the thumbnail.js condition, `!isTall`. The operation is only valid for
  an existing thumbnail so the `hasThumbnail` remains unchanged.

This patch also clarifies that the "flipped" classes are exclusively set
by using an if / else chain instead of reconsidering all inputs for each
condition.

Bug: T190831
Change-Id: I4062ec7068dcadecbdbc4791447ea2ed1ce2a1de
2018-04-13 09:25:22 -05:00
..
pagePreview Hygiene: split LESS into components 2018-04-03 16:37:05 -07:00
preview Hygiene: split LESS into components 2018-04-03 16:37:05 -07:00
settingsDialog Hygiene: split LESS into components 2018-04-03 16:37:05 -07:00
popup.less Hygiene: consolidate clip-path manipulation 2018-04-13 09:25:22 -05:00
templateUtil.js Hygiene: favor const 2018-03-21 10:44:24 +00:00