Updated ellipsis.js to handle when layout is being switched

such as window resize or if the orientation is changed such as being viewed on a mobile device.