Kill 'hit return to send'...
This commit is contained in:
parent
6f73b2870b
commit
822f08e3ed
27
js/util.js
27
js/util.js
|
@ -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
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user