Repair JS when resized