Live coder JS adjustments

This commit is contained in:
Derek Montgomery 2016-08-02 16:26:55 -05:00
parent fe4bcef4ae
commit 988f1346c1
2 changed files with 8 additions and 7 deletions

View File

@ -93,6 +93,9 @@ function loadLiveCoders(){
$(elem).find("[data-id='live-coder-answer']").load("/live-coder-entry/" + qid, function(){ $(elem).find("[data-id='live-coder-answer']").load("/live-coder-entry/" + qid, function(){
$(elem).find('.js-error').addClass('hidden'); $(elem).find('.js-error').addClass('hidden');
$(elem).find(".code-input textarea").linedtextarea(); $(elem).find(".code-input textarea").linedtextarea();
if(window.location.href.indexOf("summary") > -1) {
$(elem).find(".code-input textarea").attr('disabled', true);
}
updateResults(this); updateResults(this);
}); });
}); });

View File

@ -165,7 +165,7 @@ var saveClickHandler = function(e) {
$('.answer-block').prop('disabled', true); $('.answer-block').prop('disabled', true);
// Question events // Question events
$('.answer-sec') $('.answer-sec')
.find('.button-cancel, .button-save').hide().end() .find('.button-cancel, .button-save').hide().end()
// // delegating events // // delegating events
.on('click', '.button-edit', editClickHandler) .on('click', '.button-edit', editClickHandler)
@ -173,12 +173,10 @@ $('.answer-block').prop('disabled', true);
.on('click', '.button-save', saveClickHandler); .on('click', '.button-save', saveClickHandler);
// Dynamically load in coders // Dynamically load in coders
$.each($('.answer-sec.live-coder-type'), function(index, elem){ $.each($('.answer-sec.live-coder-type'), function(index, elem){
var qid = $(elem).data('qid'); var qid = $(elem).data('qid');
$(elem).find("[data-id='live-coder-answer']").load("/live-coder-entry/" + qid, function(){ $(elem).find("[data-id='live-coder-answer']").load("/live-coder-entry/" + qid, function(){
$(elem).find('.js-error').addClass('hidden'); $(elem).find('.js-error').addClass('hidden');
// updateResults(); $(elem).find(".code-input textarea").linedtextarea();
$(elem).find(".code-input textarea").linedtextarea();
}); });
}); });