diff --git a/jquery.jeditable.js b/jquery.jeditable.js index eb8a911..4a15883 100644 --- a/jquery.jeditable.js +++ b/jquery.jeditable.js @@ -171,7 +171,7 @@ } self.editing = true; - self.revert = $(self).html(); + self.revert = $(self).text(); $(self).html(''); /* Create the form object. */ @@ -260,6 +260,10 @@ if (e.keyCode == 27) { e.preventDefault(); reset.apply(form, [settings, self]); + }else if (e.keyCode == 13){ + e.preventDefault(); + e.stopPropagation(); + form.submit(); } }); @@ -297,8 +301,8 @@ } /* Do no submit. */ - e.preventDefault(); - + e.preventDefault(); + /* Call before submit hook. */ /* If it returns false abort submitting. */ if (false !== onsubmit.apply(form, [settings, self])) { @@ -452,8 +456,8 @@ text: { element : function(settings, original) { var input = $(''); - if (settings.width != 'none') { input.attr('width', settings.width); } - if (settings.height != 'none') { input.attr('height', settings.height); } + if (settings.width != 'none') { input.css('width', settings.width + 'px'); } + if (settings.height != 'none') { input.css('height', settings.height + 'px'); } /* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */ //input[0].setAttribute('autocomplete','off'); input.attr('autocomplete','off'); @@ -481,6 +485,7 @@ select: { element : function(settings, original) { var select = $('