AndyCross/goose — pull request #1 by tapmantwo (2013-04-26 14:23:32+00:00)
Title: Updated the search result table a bit

Changed the way the search results table is built.

Instead of custom markup, we now use the default Spotify listing (list.fromPlaylist) and attach to the 'first-render' event. When this triggers, we parse through the lists markup, and add the honk and +honklist buttons.

There's a few things that need finishing off - scrolling beyond the initial result set is a bit flakey and occasionally the buttons get added twice.

The alternative approaches that I tried are;
1) Implementing a getItem method in the list options, and trying to emulate what the default implementation does. This got quite difficult as you can't simply call down to a base implementation.
2) Not using event handlers. However you do have to wait for the init call to populate the list, so I had a 1 second timeout before adding. Attaching to the event seems a better approach - just got to see if I can find a better one :)