Closed jzuschlag closed 9 years ago
This is fixed in 0.9+
You are right. I had some difficulties to find the commit since there is a break in history in Github. But why do we keep "e" in the java code? Is there another use case? I couldn't find one, but I am not so familiar with manage.
e stands for event that is passed to disable_enter_key function which acts as keypress event handler here: https://github.com/diefenbach/django-lfs/blob/master/lfs/manage/static/lfs/js/lfs.manage.js#L553
Have a look at: https://api.jquery.com/keypress/ for documentation. window.event is old style used by IE < 9
Yeah, I just found the added event handler. Thanks anyway. So you will remove the old style sooner or later.
well, e is never assigned, that's obvious:
input class="refresh-on-keyup" type="text" value="" onkeypress="return disable_enter_key()" style="width:100%" name="name"
but:
function disable_enter_key(e) { var key; if (window.event) key = window.event.keyCode; else key = e.which; if (key == 13) return false; else return true; }
Test: Open products in management, open a Firebug console, enter just one letter in search field.
Doesn't seem to do any bad so far.