Created
March 20, 2015 21:01
-
-
Save whitmanc/5a9a8a96f15b8af37290 to your computer and use it in GitHub Desktop.
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
## | |
# Main view of app with left/right slide panels. | |
# The dashboard also houses the message list | |
# and new message form. To access anything other | |
# than a list of messages, we navigate to a new | |
# page | |
# | |
# @class DashboardView | |
# | |
define [ | |
'backbone' | |
'underscore' | |
'config' | |
'jade!templates/dashboard' | |
'views/messages/messages_view' | |
'views/messages/new_message_view' | |
], (Backbone, _, config, template, MessagesView) -> | |
class View extends Backbone.View | |
initialize: (options) -> | |
super | |
@ | |
render: -> | |
# Fire `create` event for jquery-mobile | |
# to know to reinitialize on newly | |
# rendered elements | |
@$el.html(template()).trigger('create') | |
@renderMessagesView() | |
@renderNewMessageView() | |
renderMessagesView: -> | |
(new MessagesView(el: @$('#messages'))).render() | |
renderNewMessageView: -> | |
(new NewMessageView(el: @$('#new-message'))).render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment