2016-08-19 16:02:18 -05:00
|
|
|
$(function(){
|
|
|
|
|
2016-08-22 16:24:00 -05:00
|
|
|
$("form").on('click', "[data-id=input_option_adder]", function(){
|
2016-08-19 16:02:18 -05:00
|
|
|
var $new_li = $(this).siblings('li').clone();
|
|
|
|
$new_li.attr('style', '');
|
|
|
|
$("[data-id=input_option_list]").append($new_li);
|
|
|
|
$new_li.find('input').focus();
|
|
|
|
});
|
|
|
|
|
2016-08-22 16:24:00 -05:00
|
|
|
$("#question_input_type").on('change', function(){
|
|
|
|
var qid = $(this).attr('data-qid') === undefined ? '' : "/" + $(this).attr('data-qid');
|
|
|
|
// /admin/question(/:question_id)/options/:input_type
|
|
|
|
$("[data-id=input-options-wrapper]").load("/admin/question" + qid + "/options/" + $(this).val());
|
|
|
|
});
|
|
|
|
|
2016-08-19 16:02:18 -05:00
|
|
|
});
|