submit new map form on Enter - fixes #555 (#562)

* submit new map form on Enter - fixes #555

* update divs too
This commit is contained in:
Devin Howard 2016-07-01 16:48:38 +08:00 committed by GitHub
parent 6c22ebcc51
commit 872ae90832

View file

@ -216,6 +216,10 @@ Metamaps.GlobalUI.CreateMap = {
bindFormEvents: function () {
var self = Metamaps.GlobalUI.CreateMap;
$('.new_map input, .new_map div').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();