Fix typo in share/embed popup JavaScript

The cases for the ternary operator were reversed.

Addresses #824