Update viewport.js

fix cocoonjs crash