Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded Backbone, Underscore, jQuery. Also templatized the movie tab…
…le and created a new view for the select control. Finally, I also started the refactoring of views to follow the new design pattern.
- Loading branch information
1 parent
3ad86ff
commit 9c333d9
Showing
7 changed files
with
82 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var ListControlsView = Backbone.View.extend({ | ||
id: "SearchControls", | ||
template: $("#TMPSearchControls").html(), | ||
|
||
initialize: function(opts){ | ||
_.bindAll(this, | ||
'render', | ||
'listChanged'); | ||
this.collection = window.COTM.movies; | ||
$("#MovieTableContainer").append(this.$el); | ||
}, | ||
|
||
events: { | ||
"change #MovieList" : "listChanged" | ||
}, | ||
|
||
listChanged: function(e){ | ||
//We'll simply change trigger a routing action. | ||
//This gives us bookmarkable urls and simplifies our code. | ||
var new_list = $(e.target).val(); | ||
window.COTM.navigate("!list/" + new_list, {trigger: true, replace: true}); | ||
window.COTM.logEvent("The Movie List changed. We called for new data from the API: " + new_list); | ||
}, | ||
|
||
render: function(){ | ||
this.$el.html( $.mustache( this.template ) ); | ||
return this; | ||
} | ||
}); |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ th.title{ | |
width: 147px | ||
} | ||
|
||
#WOTY{ | ||
#ListType{ | ||
font-size:17px; | ||
font-weight: bold; | ||
} |
This file contains 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 file contains 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