Move document viewer JS initializer into separate partial