counter(null);
}
- function submitonreturn(event) {
- if (event.keyCode == 13 || event.keyCode == 10) {
- // iPhone sends \n not \r for 'return'
- $("#form_notice").submit();
- event.preventDefault();
- event.stopPropagation();
- $("#notice_data-text").blur();
- $("body").focus();
- return false;
- }
- return true;
- }
+
// define maxLength if it wasn't defined already
counter();
}
- $("#notice_data-text").bind("keydown", submitonreturn);
+ $('#'+SN.C.S.NoticeDataText).bind('keydown', function(e) {
+ SN.U.SubmitOnReturn(e, $('#'+SN.C.S.FormNotice));
+ });
if($('body')[0].id != 'conversation') {
$("#notice_data-text").focus();
},
U: { // Utils
+ SubmitOnReturn: function(event, el) {
+ if (event.keyCode == 13 || event.keyCode == 10) {
+ el.submit();
+ event.preventDefault();
+ event.stopPropagation();
+ $('#'+SN.U.NoticeDataText).blur();
+ $('body').focus();
+ return false;
+ }
+ return true;
+ },
+
FormXHR: function(f) {
f.bind('submit', function(e) {
form_id = $(this)[0].id;