Commit b700153c authored by Martin Gregor's avatar Martin Gregor
Browse files

#1,#2,#3,#4 fix poziciovania,auto focus,

parent 6ed02dd6
......@@ -310,7 +310,14 @@ class HomepagePresenter extends BasePresenter
'Content-Type' => 'text/plain'
];
$result = $curl->post($this->lematization_service,$sentence);
try
{
$result = $curl->post($this->lematization_service,$sentence);
}
catch (CurlException $e)
{
return;
}
if (strstr($result->body,'Error report') == FALSE)
{
......
......@@ -61,9 +61,11 @@ $(function(){
{
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');
}
$(this).removeClass('btn-default').addClass('btn-success');
$(this).next().removeClass('btn-danger').addClass('btn-default');
var input = $(this).parent().find('input');
if (input.is(':visible'))
{
......@@ -98,12 +100,13 @@ $(function(){
function show_input(btn,word_n)
{
var input = btn.parent().find('input');
var wrapper = btn.parent().parent();
var position = wrapper.position();
position.left = position.left - 50 > 0 ? position.left - 50 : 0;
position.top = position.top - 30 > 0 ? position.top - 30 : 0;
if (input.length == 0)
{
var wrapper = btn.parent().parent();
var position = wrapper.position();
position.left = position.left - 50;
position.top = position.top - 30;
wrapper.css({'top': position.top + 'px','left': position.left + 'px'});
input = btn.parent().parent().parent().parent().parent().parent().next();
if (word_n == 1)
......@@ -113,18 +116,13 @@ $(function(){
input = input.find('input').css({"width":"100%","margin-top":"5px"});
input.appendTo(btn.parent());
}
else
else if (input.is(':hidden'))
{
if (input.is(':hidden'))
{
var wrapper = btn.parent().parent();
var position = wrapper.position();
position.left = position.left - 50;
position.top = position.top - 30;
wrapper.css({'top': position.top + 'px','left': position.left + 'px'});
}
wrapper.css({'top': position.top + 'px','left': position.left + 'px'});
input.show();
}
input.focus();
}
//preklad slova
......@@ -135,6 +133,13 @@ $(function(){
word_sk.toggleClass('hidden');
});
$('body').on('click','.translation',function(e) {
e.preventDefault();
$(this).find('.sk-word').toggleClass('hidden');
$(this).find('.en-word').toggleClass('hidden');
});
//osetrenie stlacenia enteru v inpute na preklad
$('input.text').keypress(function(e){
if(e.which == 13)
{
......
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