[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"
var2="id='%s_%d' % (ajaxHookId, objectIndex);
dropdownId='%s_dd' % id;
imgId='%s_img' % id"
imgId='%s_img' % id;
inputId='%s_v' % id"
onmouseover=":'toggleDropdown(%s)' % q(dropdownId)"
onmouseout=":'toggleDropdown(%s,%s)' % (q(dropdownId), q('none'))">
<input type="text" size=":numberWidth" id=":id" value=":objectIndex+1"
onclick="this.select()"
<input type="text" size=":numberWidth" id=":inputId"
value=":objectIndex+1" onclick="this.select()"
onkeydown=":'if (event.keyCode==13) \
document.getElementById(%s).click()' % q(imgId)"/>
<!-- The menu -->

View file

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