minimize/maximize/restore fixes; JS code style reformating