Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into with_other_for_all…
Browse files Browse the repository at this point in the history
…_questions
  • Loading branch information
vr2262 committed Feb 15, 2015
2 parents 66de40e + 1cc6519 commit 655b5b6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,17 @@ Survey.prototype.render = function(question) {
var self = this;
var content = $('.content');

var widgetHTML;
var widgetTemplate;
var compiledHTML;

var index = question ? question.sequence_number : this.questions.length + 1;

if (question) {
// Show widget
var widgetHTML = $('#widget_' + question.type_constraint_name).html();
var widgetTemplate = _.template(widgetHTML);
var compiledHTML = widgetTemplate({question: question, start_loc: App.start_loc});
widgetHTML = $('#widget_' + question.type_constraint_name).html();
widgetTemplate = _.template(widgetHTML);
compiledHTML = widgetTemplate({question: question, start_loc: App.start_loc});
self.current_question = question;

// Render question
Expand All @@ -248,9 +252,9 @@ Survey.prototype.render = function(question) {

} else {
// Show submit page
var widgetHTML = $('#template_submit').html();
var widgetTemplate = _.template(widgetHTML);
var compiledHTML = widgetTemplate({name: App.submitter_name});
widgetHTML = $('#template_submit').html();
widgetTemplate = _.template(widgetHTML);
compiledHTML = widgetTemplate({name: App.submitter_name});

content.empty()
.data('index', index)
Expand Down

0 comments on commit 655b5b6

Please sign in to comment.