submit new map form on Enter - fixes #555

This commit is contained in:
Devin Howard 2016-06-30 11:24:52 +08:00
parent 6c22ebcc51
commit 357e21a96e

View file

@ -216,6 +216,10 @@ Metamaps.GlobalUI.CreateMap = {
bindFormEvents: function () {
var self = Metamaps.GlobalUI.CreateMap;
$('.new_map input').unbind('keypress').bind('keypress', function(event) {
if (event.keyCode === 13) self.submit()
})
$('.new_map button.cancel').unbind().bind('click', function (event) {
event.preventDefault();
Metamaps.GlobalUI.closeLightbox();