Исключил из навигации по клавшиам неактивные фото (при выбранном первым из пары)

parent 909363bc
......@@ -489,11 +489,6 @@ $(document).ready(function(){
if ($fotoFocused.length>0) {
$('.b-foto_inner', $fotoFocused).click();
}
}
// Вниз
......@@ -543,13 +538,19 @@ $(document).ready(function(){
if ($fotoFocused.length>0) {
var
$double = $fotoFocused.parents('.b-foto-double'),
$prevDouble = $double.prev('.b-foto-double');
$prevDouble;
if ($folderContent.hasClass('has-selected')) {
$prevDouble = $double.prev('.b-foto-double:not(.pair)');
} else {
$prevDouble = $double.prev('.b-foto-double');
}
if ($fotoFocused.index($('.b-foto', $double)) == 0) {
if ($prevDouble.length>0) {
$prevFoto = $('.b-foto', $prevDouble).first();
} else {
//$prevFoto = $fotoFocused;
unFocusAll = true;
}
} else {
......@@ -557,10 +558,13 @@ $(document).ready(function(){
$prevFoto = $('.b-foto', $prevDouble).last();
if ($prevFoto.hasClass('fict')) $prevFoto = $fotoFocused;
} else {
//console.log('AAA Переход на 1-ю строку');
$prevDouble = $('.b-foto-double', $folderContent).last();
$prevFoto = $('.b-foto', $prevDouble).first();
}
}
} else {
return false;
}
$('.b-foto', $folderContent).removeClass('focus');
......@@ -587,7 +591,12 @@ $(document).ready(function(){
if ($nextDouble.length>0) {
$nextFoto = $('.b-foto', $nextDouble).first();
} else {
$nextDouble = $('.b-foto-double', $folderContent).first();
//console.log('AAA Переход на 2-ю строку');
if ($folderContent.hasClass('has-selected')) {
$nextDouble = $('.b-foto-double:not(.pair)', $folderContent).first();
} else {
$nextDouble = $('.b-foto-double', $folderContent).first();
}
$nextFoto = $('.b-foto', $nextDouble).last();
}
} else {
......@@ -600,7 +609,14 @@ $(document).ready(function(){
}
} else {
$nextFoto = $('.b-foto', $folderContent).first();
if ($folderContent.hasClass('has-selected')) {
$nextFoto = $('.b-foto-double:not(.pair) .b-foto', $folderContent).first();
} else {
$nextFoto = $('.b-foto', $folderContent).first();
}
}
$('.b-foto', $folderContent).removeClass('focus');
......
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