Trigger the close event on window resize.
Trigger the close event on window resize.

This fixes #19. When the window is resized, if the sidebar is in the closed state, we trigger the sidebar:close event, so the sidebar will be closed.
In previous versions, if the sidebar was having percentage sizes (height or/and width) it would appear on the window margin when the window would get resized.

Also, we now store the settings object reference in the `sidebar` data (jQuery).

This commit also fixes #22. :fire:

silviubogan/jQuery-sidebar,silviubogan/jQuery-sidebar,jillix/jQuery-sidebar,jillix/jQuery-sidebar