Update collapse.js

when dimension is width we should use the `innerWidth`