Commit 51e3f1bf authored by Martin Gregor's avatar Martin Gregor
Browse files

oprava checkovania radiobuttonov

parent 5306ffd8
......@@ -204,10 +204,13 @@ class HomepagePresenter extends BasePresenter
{
$words[$position] = '<span class="translation label label-primary" data-animation="true" data-html="true" data-placement="auto bottom"'
.' data-trigger="manual" data-content="
<button type=\'button\' class=\'btn btn-success correct\'>
<button type=\'button\' class=\'btn btn-info translate\' title=\'Preložiť\'>
<span class=\'glyphicon glyphicon-book\'></span>
</button>
<button type=\'button\' class=\'btn btn-success correct\' title=\'Správny preklad\'>
<span class=\'glyphicon glyphicon-thumbs-up\'></span>
</button>
<button type=\'button\' class=\'btn btn-danger incorrect\'>
<button type=\'button\' class=\'btn btn-danger incorrect\' title=\'Nesprávny preklad\'>
<span class=\'glyphicon glyphicon-thumbs-down\'></span>
</button>
">'
......
......@@ -61,6 +61,7 @@ $(function(){
if (typeof(check[r_name][next_w_n]) == "undefined" || check[radio.attr('name')][next_w_n] == null || check[r_name][next_w_n] == true)
{
radio.attr('checked',true);
radio.parent().find('input[value="incorrect"]').attr('checked',false);
$(this).removeClass('btn-default').addClass('btn-success');
$(this).next().removeClass('btn-danger').addClass('btn-default');
}
......@@ -79,6 +80,7 @@ $(function(){
}
check[r_name][word_n] = false;
radio.attr('checked',true);
radio.parent().find('input[value="correct"]').attr('checked',false);
$(this).removeClass('btn-default').addClass('btn-danger');
$(this).prev().removeClass('btn-success').addClass('btn-default');
show_input($(this),word_n);
......@@ -102,6 +104,13 @@ $(function(){
{
input.show();
}
}
//preklad slova
$('body').on('click','button.translate',function() {
var word_sk = $(this).parent().parent().prev().find('.sk-word');
var word_en = $(this).parent().parent().prev().find('.en-word');
word_en.toggleClass('hidden');
word_sk.toggleClass('hidden');
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment