Created
February 6, 2012 21:45
-
-
Save robertothais/1755105 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| var options = { | |
| elemId: 'venue_submissions_filters', | |
| allGenres:<%= Artist::GENRES.to_json %>, | |
| allTags: <%= submission_tag_options.map{|name,v|{:name => name, :value => v}}.to_json %>, | |
| webServer: '<%= WEB_SERVER %>', | |
| widgetServer: '<%= widget_server %>', | |
| pageSize: <%= ArtistSearch::PAGE_SIZE %>, | |
| maxPages: <%= ArtistSearch::MAX_PAGE %>, | |
| venueId: '<%= @venue.id %>', | |
| submissionCounts: <%= @venue.submission_counts.to_json %> | |
| }; | |
| Reverb.VenueSubmissionFilter.instance = new Reverb.VenueSubmissionFilter(options); | |
| Reverb.VenueSubmissionFilter.instance.applyParams(<%= @venue.most_recent_search %>); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| On venue_submissions.js the first observableArray actually maps properly into the UI element. Programmatically pushing a new object adds the options into the select element. This doesn't happen with the second two observableArrays in either direction. This is reflected in the params that get posted: no tag information is to be found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.viewModel.all_tags = ko.observableArray(options.allTags); | |
| this.viewModel.search_options.selected_tags = ko.observableArray([]) | |
| this.viewModel.selected_tags = ko.observableArray([]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment