jez500 / chorus

A Web UI for XBMC, focused on user experience and music. Get the latest version here: https://github.com/xbmc/chorus2
357 stars 55 forks source link

Fix dialog repeatedly binding keypress event #117

Closed christianprescott closed 9 years ago

christianprescott commented 9 years ago

app.helpers.dialog binds another dialogopen event every time a dialog is opened. Each of those dialogopens then binds another keypress function each time the dialog is opened. The exponential growth of keypress functions is problematic for prompts, where the resulting button click triggers some action. :o

Moves the binding to app.helpers.dialogInit where they should only bind once.

christianprescott commented 9 years ago

unbind() does work just as well. Not sure I agree that it's better, but it's up to you!

jez500 commented 9 years ago

Unbind is much nicer IMO. Cheers!