Skip to content

Commit

Permalink
Fixed issue #07770: Clicking radio button on dual scale does not trig…
Browse files Browse the repository at this point in the history
…ger condition

Dev: Only for 2.05, because updated CellAdapters in 2.05
  • Loading branch information
Shnoulle committed Apr 18, 2013
1 parent dc15888 commit 41f35ef
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/dualscale.js
Expand Up @@ -17,28 +17,28 @@
*
* @author Denis Chenu (Shnoulle)
* @param {number} qId The qid of the question where apply.
* @version 205-01
*/
function doDualScaleRadio(qID) {
// We can do it before document ready, because function come after answers and we use delegate
$("#question"+qID+" .jshide").hide();

// Lauch EM with hidden input
$("#question"+qID+" table.question").delegate(".noanswer-item","click",function(){
$(this).closest("tr").find(".answer-item :radio").removeAttr("checked");
$(this).closest("tr").find(".noanswer-item :radio").attr("checked","checked");
name=$(this).find(":radio").attr("name");
$("#question"+qID+" table.question").delegate(".noanswer-item :radio","click",function(){
$(this).closest(".answers-list").find(":radio[value='']").prop("checked", true);
name=$(this).attr("name");
name0=name.replace("#1","_0");
name1=name.replace('#','_');
$("#java"+name0).val("");
$("#java"+name1).val("");
ExprMgr_process_relevance_and_tailoring('change',name0,'hidden');
ExprMgr_process_relevance_and_tailoring('change',name1,'hidden');
});
$("#question"+qID+" table.question").delegate(".answer-item:not(.noanswer-item)","click",function(){// Don't attach to radio because prepareCellAdapters don't throw click ...
name=$(this).find(":radio").attr("name");
$("#question"+qID+" table.question").delegate(".answer-item:not(.noanswer-item) :radio","click",function(){
$(this).closest(".answers-list").find(":radio[value='']").prop("checked", false);
name=$(this).attr("name");
name=name.replace('#','_');
value=""+$(this).find(":radio").val();
$(this).closest("tr").find(".noanswer-item :radio").removeAttr("checked");
value=""+$(this).val();
$("#java"+name).val(value);
ExprMgr_process_relevance_and_tailoring('change',name,'radio');
});
Expand Down

0 comments on commit 41f35ef

Please sign in to comment.