Commit a7c4ee1105678cc2c2fa8f0ddc4f45e5087f8bf7

Authored by Georg Hopp
1 parent 92765749

jetzt schein t die auswahl via enter zu funktionieren, ausserdem ein paar kleine…

… cleanups die mir aufgefallen sind.
Showing 1 changed file with 7 additions and 13 deletions
... ... @@ -117,7 +117,7 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person)
117 117 }
118 118
119 119 if (this.person != null)
120   - if (this.fNameBest[1] == 0)
  120 + if (this.sNameBest[1] == 0 && this.fNameBest[1] == 0)
121 121 this.person.update (
122 122 this.persons[this.sNameBest[2]][this.fNameBest[2]]);
123 123 else
... ... @@ -157,7 +157,7 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person)
157 157 len < dists.lenth)
158 158 len++;
159 159 else
160   - len = dists.length - 1;
  160 + len = dists.length;
161 161
162 162 for (var i=0; i<len; i++)
163 163 // walk through all matches
... ... @@ -188,7 +188,7 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person)
188 188 return len;
189 189 }
190 190
191   - this.altSurnames = function (_event)
  191 + this.altSurnames = function ()
192 192 {
193 193 var surname = document.getElementById (this.surname);
194 194 var sNameAlt = document.getElementById (this.sNameAlt);
... ... @@ -279,8 +279,6 @@ function personSearch1AltFirstnameHandler (_event)
279 279 else if (_event.keyCode)
280 280 var keycode = _event.keyCode;
281 281
282   - var dists = pSearch1.fnameDists;
283   -
284 282 // pSearch1 wird im php personSearch1.js angelegt.
285 283 switch (keycode)
286 284 {
... ... @@ -291,13 +289,12 @@ function personSearch1AltFirstnameHandler (_event)
291 289 pSearch1.incFnameIdx ();
292 290 break;
293 291 case 13:
294   - pSearch1.hide ('personSearch1_fBestFit');
295   - break;
  292 + return pSearch1.hide ('personSearch1_fBestFit');
296 293 default:
297 294 pSearch1.fnameIdx = -1;
298 295 }
299 296
300   - pSearch1.altFirstnames ();
  297 + return pSearch1.altFirstnames ();
301 298 }
302 299
303 300 function personSearch1AltSurnameHandler (_event)
... ... @@ -310,8 +307,6 @@ function personSearch1AltSurnameHandler (_event)
310 307 else if (_event.keyCode)
311 308 var keycode = _event.keyCode;
312 309
313   - var dists = pSearch1.snameDists;
314   -
315 310 // pSearch1 wird im php personSearch1.js angelegt.
316 311 switch (keycode)
317 312 {
... ... @@ -322,11 +317,10 @@ function personSearch1AltSurnameHandler (_event)
322 317 pSearch1.incSnameIdx ();
323 318 break;
324 319 case 13:
325   - pSearch1.hide ('personSearch1_sBestFit');
326   - break;
  320 + return pSearch1.hide ('personSearch1_sBestFit');
327 321 default:
328 322 pSearch1.snameIdx = -1;
329 323 }
330 324
331   - pSearch1.altSurnames ();
  325 + return pSearch1.altSurnames ();
332 326 }
... ...
Please register or login to post a comment