nixme / warble

The intelligent communal jukebox
10 stars 2 forks source link

Source views should be independent from their container. #6

Closed arbales closed 12 years ago

arbales commented 13 years ago

So I can explore some UI changes more easily.

nixme commented 13 years ago

I don't understand this. What do you mean?

arbales commented 13 years ago

Sorry, I mean the station views. Are they still linked together?

nixme commented 13 years ago

All the templates are in the views folder under application or player. The js view controllers are in scripts/ui. Or are you talking about how they all are within a single #app element? That does need to change, especially to fix all the extra delegateEvents calls we're making.

arbales commented 13 years ago

delegateEvents reloads event delegation after element insertion? Similar to Event.addBehaviors.reload

nixme commented 13 years ago

Yes, but you shouldn't have to explicitly call it as Backbone calls it after initialize. However, all our views for the panel are sharing the same #add element. So whichever view gets initialized last wins owning the events/behavior for #add. That's why everytime a panel takes over (by having render called on it), it reloads its events/behaviors.

The right thing™ to do is to have individual elements for each panel, but keep them hidden. The controller class will then be responsible for hiding/showing/fading/sliding them in and out. That way the events/behaviors are fully loaded when the page is initialized and we don't need to worry event delegation anymore.

I will tackle it this weekend hopefully along with splitting up the stylesheet.

nixme commented 12 years ago

This is fixed on master.