Made click-to-close work with old modal dialogs (#1340)