Notalib / LYT

m.e17.dk
GNU Lesser General Public License v3.0
10 stars 12 forks source link

Free text search is setting the loading message multiple times #462

Closed mzedeler closed 11 years ago

mzedeler commented 11 years ago

To reproduce:

Expected: in the log, setMessage should only appear once every time a search is executed. Actual: in the log, setMessage appears once for every time a previous search has been run, thus executing a new search now, will result in 7 setMessage messages.

kirkby commented 11 years ago

Note: I was not able to reproduce original bug as described above: I would only receive two setMessage's for each search.

kirkby commented 11 years ago

Seconds thoughts; in #search, maybe the correct location to call Loader is NOT in handleResults() handler but in switch section when action has been determined?

everhoej commented 11 years ago

Tested. The problem can only be reproduced when you choose a suggestion from the drop down menu,

kirkby commented 11 years ago

Added $("#searchterm").unbind "autocompleteselect", (event, ui) at line before bind. Solved the problem quickly.

kirkby commented 11 years ago

This has been solved by unbinding clickhandler before binding. Apparently this is not best practice. However, someone who knows best practice should have a go at it at a later time. Closed.