Closed (fixed)
Project:
Chatblock
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Mar 2009 at 21:32 UTC
Updated:
5 Dec 2011 at 16:30 UTC
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
Comment #1
dwees commentedFixing some formatting caused by a poor editor:
Comment #2
sbart76 commentedFor me it works :-) Thank you!
Comment #3
doitDave commentedPatch modified and implemented. Works.
Comment #4
doitDave commented