Kill 'hit return to send'...

This commit is contained in:
Brion Vibber 2011-03-03 16:14:36 -08:00
parent 6f73b2870b
commit 822f08e3ed
2 changed files with 1 additions and 28 deletions

View File

@ -132,10 +132,6 @@ var SN = { // StatusNet
// Note there's still no event for mouse-triggered 'delete'. // Note there's still no event for mouse-triggered 'delete'.
NDT.bind('cut', delayedUpdate) NDT.bind('cut', delayedUpdate)
.bind('paste', delayedUpdate); .bind('paste', delayedUpdate);
NDT.bind('keydown', function(e) {
SN.U.SubmitOnReturn(e, form);
});
} }
else { else {
form.find('#'+SN.C.S.NoticeTextCount).text(jQuery.data(form[0], 'ElementData').MaxLength); form.find('#'+SN.C.S.NoticeTextCount).text(jQuery.data(form[0], 'ElementData').MaxLength);
@ -146,29 +142,6 @@ var SN = { // StatusNet
} }
}, },
/**
* To be called from keydown event handler on the notice import form.
* Checks if return or enter key was pressed, and if so attempts to
* submit the form and cancel standard processing of the enter key.
*
* @param {Event} event
* @param {jQuery} el: jQuery object whose first element is the notice posting form
*
* @return {boolean} whether to cancel the event? Does this actually pass through?
* @access private
*/
SubmitOnReturn: function(event, el) {
if (event.keyCode == 13 || event.keyCode == 10) {
el.submit();
event.preventDefault();
event.stopPropagation();
$('#'+el[0].id+' #'+SN.C.S.NoticeDataText).blur();
$('body').focus();
return false;
}
return true;
},
/** /**
* To be called from event handlers on the notice import form. * To be called from event handlers on the notice import form.
* Triggers an update of the remaining-characters counter. * Triggers an update of the remaining-characters counter.

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long