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