Layout updates in JS code