Skip to content

Commit

Permalink
disable input when swiping through clues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily2point0 committed May 18, 2017
1 parent 1391817 commit 45cc4f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/js/oCrossword.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ OCrossword.prototype.assemble = function assemble() {
magicInput.style.top = magicInputTargetEl.offsetTop + 'px';
magicInput.focus();
magicInput.select();

debounce(function(){
magicInput.focus();
magicInput.select();
Expand Down Expand Up @@ -581,6 +581,7 @@ OCrossword.prototype.assemble = function assemble() {
const onTap = function onTap(e) {
let target;
let clueDetails;
let isNavigation = false;
blockHighlight = false;

if (e.target.nodeName === 'TD' || e.target.nodeName === 'INPUT') {
Expand All @@ -591,6 +592,7 @@ OCrossword.prototype.assemble = function assemble() {

if(e.target.nodeName === 'A') {
defEl = navigateClues(e);
isNavigation = true;
} else {
defEl = (e.target.nodeName === 'SPAN')?e.target.parentElement:e.target;
}
Expand Down Expand Up @@ -660,12 +662,15 @@ OCrossword.prototype.assemble = function assemble() {
currentlySelectedGridItem.direction,
currentlySelectedGridItem.answerLength
);
takeInput(cell, getGridCellsByNumber(
gridEl,
currentlySelectedGridItem.number,
currentlySelectedGridItem.direction,
currentlySelectedGridItem.answerLength
));

if(!isNavigation) {
takeInput(cell, getGridCellsByNumber(
gridEl,
currentlySelectedGridItem.number,
currentlySelectedGridItem.direction,
currentlySelectedGridItem.answerLength
));
}
}
}.bind(this);

Expand Down
1 change: 1 addition & 0 deletions src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
background-repeat: no-repeat;
background-size: cover;
margin-top: 8px;
user-select: none;
}

&.o-crossword-clue-nav-next {
Expand Down

0 comments on commit 45cc4f5

Please sign in to comment.