Dialog: Better method of constraining dimensions and some jshint fixes