Skip to content

Commit

Permalink
Merge pull request #53 from AnastasiaBuniakEPAM/JS-255
Browse files Browse the repository at this point in the history
JS-324: Fix thumb-arrow tabindex
  • Loading branch information
uharbachou1 committed Nov 26, 2015
2 parents bb8f918 + 4992a2d commit 1b087f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
17 changes: 11 additions & 6 deletions lib/web/fotorama/fotorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,13 @@ fotoramaVersion = '4.6.4';
return !!el.getAttribute('disabled');
}

function disableAttr(FLAG) {
return {tabindex: FLAG * -1 + '', disabled: FLAG};
function disableAttr(FLAG, disable) {
if (disable) {
return {disabled: FLAG};
} else {
return {tabindex: FLAG * -1 + '', disabled: FLAG};

}
}

function addEnterUp(el, fn) {
Expand Down Expand Up @@ -2613,10 +2618,10 @@ fotoramaVersion = '4.6.4';
disableNext = disableDirrection(1);
$arrPrev
.toggleClass(arrDisabledClass, disablePrev)
.attr(disableAttr(disablePrev));
.attr(disableAttr(disablePrev, false));
$arrNext
.toggleClass(arrDisabledClass, disableNext)
.attr(disableAttr(disableNext));
.attr(disableAttr(disableNext, false));
}

function thumbArrUpdate() {
Expand All @@ -2633,10 +2638,10 @@ fotoramaVersion = '4.6.4';
}
$thumbArrLeft
.toggleClass(arrDisabledClass, isLeftDisable)
.attr(disableAttr(isLeftDisable));
.attr(disableAttr(isLeftDisable, true));
$thumbArrRight
.toggleClass(arrDisabledClass, isRightDisable)
.attr(disableAttr(isRightDisable));
.attr(disableAttr(isRightDisable, true));
}

function stageWheelUpdate() {
Expand Down
4 changes: 2 additions & 2 deletions lib/web/mage/gallery/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<div class="fotorama__nav-wrap" data-gallery-role="nav-wrap">
<div class="fotorama__nav fotorama__nav--thumbs">
<div class="fotorama__fullscreen-icon" data-gallery-role="fotorama__fullscreen-icon" tabindex="0" aria-label="Exit fullscreen" role="button"></div>
<div class="fotorama__thumb__arr fotorama__thumb__arr--left" role="button" aria-label="Previos" data-gallery-role="arrow">
<div class="fotorama__thumb__arr fotorama__thumb__arr--left" role="button" aria-label="Previos" data-gallery-role="arrow" tabindex = "-1">
<div class="fotorama__thumb--icon"></div>
</div>
<div class="fotorama__nav__shaft">
<div class="fotorama__thumb-border"></div>
</div>
<div class="fotorama__thumb__arr fotorama__thumb__arr--right" role="button" aria-label="Next" data-gallery-role="arrow">
<div class="fotorama__thumb__arr fotorama__thumb__arr--right" role="button" aria-label="Next" data-gallery-role="arrow" tabindex = "-1">
<div class="fotorama__thumb--icon"></div>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions lib/web/mage/gallery/module/_focus.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.fotorama__zoom-out:focus,
.fotorama__zoom-in:focus,
.fotorama__arr:focus,
.fotorama__arr:focus,
.fotorama__stage__shaft:focus,
.fotorama__nav__frame--thumb:focus .fotorama__thumb,
.fotorama__nav__frame--dot:focus .fotorama__dot {
Expand Down Expand Up @@ -59,4 +58,9 @@
.fotorama__thumb.fotorama_vertical_ratio:after{
bottom: 1px;
}
}
}

.fotorama__thumb__arr {
box-shadow: none;
}

0 comments on commit 1b087f7

Please sign in to comment.