Posted by dwees on March 4, 2009 at 9:32pm
Jump to:
| Project: | Chatblock |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
This problem is easily solved, and whenever I get a chance to remember how to do CVS again and sit down and resubmit some fixes, I'll include it.
Add the following to the end of chatblock.js
// check to make sure JS is enabled and functional
if (Drupal.jsEnabled) {
// add our stuff inside the header of the table
$(document).ready(function() {
$('#edit-chatblocktext').focus(function () {
// add a keydown event on focus
$(this).keydown(function (event) {
// get the event which is browser dependent
var e = event.which || event.keyCode;
if (e == 13) {
var el = document.getElementById('edit-chatblocksubmit');
chatblockSend(el);
return false;
}
else {
return true;
}
});
});
$('#edit-chatblocktext').blur(function () {
// get rid of the keydown when we don't need it anymore
$(this).unbind('keydown');
});
});
}
Comments
#1
Fixing some formatting caused by a poor editor:
// check to make sure JS is enabled and functional
if (Drupal.jsEnabled) {
// add our stuff inside the header of the table
$(document).ready(function() {
$('#edit-chatblocktext').focus(function () {
// add a keydown event on focus
$(this).keydown(function (event) {
// get the event which is browser dependent
var e = event.which || event.keyCode;
if (e == 13) {
var el = document.getElementById('edit-chatblocksubmit');
chatblockSend(el);
return false;
}
else {
return true;
}
});
});
$('#edit-chatblocktext').blur(function () {
// get rid of the keydown when we don't need it anymore
$(this).unbind('keydown');
});
});
}
#2
For me it works :-) Thank you!
#3
Patch modified and implemented. Works.
#4
#5
Automatically closed -- issue fixed for 2 weeks with no activity.