Don't add on click events on dialog open
Instead add them once durring setup
This fixes an issue where click events would fire x amount of times
depending on how many times the dialog was opened and closed, on even
times sort would run twice and not toggle.
Merge pull request #647 from Fragger/sortfix

Don't add on click events on dialog open