[gen] Ref field bugfix.

This commit is contained in:
Gaetan Delannay 2015-02-23 15:02:19 +01:00
parent dd7e2000a1
commit bf4a781b5a
2 changed files with 5 additions and 4 deletions

View file

@ -212,11 +212,12 @@ class Ref(Field):
<div if="changeNumber" class="dropdownMenu" <div if="changeNumber" class="dropdownMenu"
var2="id='%s_%d' % (ajaxHookId, objectIndex); var2="id='%s_%d' % (ajaxHookId, objectIndex);
dropdownId='%s_dd' % id; dropdownId='%s_dd' % id;
imgId='%s_img' % id" imgId='%s_img' % id;
inputId='%s_v' % id"
onmouseover=":'toggleDropdown(%s)' % q(dropdownId)" onmouseover=":'toggleDropdown(%s)' % q(dropdownId)"
onmouseout=":'toggleDropdown(%s,%s)' % (q(dropdownId), q('none'))"> onmouseout=":'toggleDropdown(%s,%s)' % (q(dropdownId), q('none'))">
<input type="text" size=":numberWidth" id=":id" value=":objectIndex+1" <input type="text" size=":numberWidth" id=":inputId"
onclick="this.select()" value=":objectIndex+1" onclick="this.select()"
onkeydown=":'if (event.keyCode==13) \ onkeydown=":'if (event.keyCode==13) \
document.getElementById(%s).click()' % q(imgId)"/> document.getElementById(%s).click()' % q(imgId)"/>
<!-- The menu --> <!-- The menu -->

View file

@ -320,7 +320,7 @@ function askBunchMove(hookId, startNumber, uid, move){
if (typeof move == 'object'){ if (typeof move == 'object'){
// Get the new index from an input field // Get the new index from an input field
var id = move.id; var id = move.id;
id = id.substr(0, id.length-4); id = id.substr(0, id.length-4) + '_v';
var input = document.getElementById(id); var input = document.getElementById(id);
if (isNaN(input.value)) { if (isNaN(input.value)) {
input.style.background = wrongTextInput; input.style.background = wrongTextInput;