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

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