e-reader error when popping out window

Moving work on BLD-465 from PR 1811.
Fixing missing import clause in Python.
Addressing DB's comment.

BLD-465.
Merge pull request #1856 from edx/valera/fix_e_reader_error_new_page

Fix for BLD-465: e-reader error when popping out window.