Created
March 30, 2012 19:09
-
-
Save billsaysthis/2254144 to your computer and use it in GitHub Desktop.
LayoutManager jQuery plugin question code sample
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
Public.Views.StarQuestionView = Backbone.View.extend({ | |
template: 'public/common/questions/starQuestion_hb', | |
className: 'questionContainer' | |
}); | |
Public.Form = Backbone.View.extend({ | |
... | |
questionView: function(question, questionNumber) { | |
var qv; | |
... | |
} else if(question.displayType === 'star') { | |
qv = new Public.Views.StarQuestionView({ serialize: {questionName: question.name, questionNumber: questionNumber } }); | |
} | |
return qv; | |
}, | |
renderReviewForm: function(manage) { | |
var qv, view = manage(this), self = this, questionNumber = 0, questions = this.model.get('review').questions; | |
_.each(questions, function(question) { | |
view.insert('#ptQuestions', self.questionView(question, ++questionNumber)); | |
}); | |
qv = new Public.Views.SocialFansView({serialize: {general: this.model.get('general')}}); | |
view.insert('.ptSidebar', qv); | |
return view.render().then(function(el) { | |
$(el).find('#ptRatingStar').raty({...options...}); | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment