add resizable option, Extract resizing code into separate directive