Skip to content

Commit

Permalink
mobile margins
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily2point0 committed Jun 13, 2017
1 parent b2df600 commit fad98ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/js/oCrossword.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ OCrossword.prototype.assemble = function assemble() {
resetButton.textContent = 'Reset grid';

this.addEventListener(resetButton, 'click', clearAnswers);
this.rootEl.insertBefore(resetButton, gridWrapper);
this.rootEl.insertBefore(resetButton, wrapper);

function constructInputIdentifier(data, direction) {
let identifier;
Expand Down Expand Up @@ -1086,6 +1086,8 @@ OCrossword.prototype.assemble = function assemble() {
clueDisplayer.style.height = clueDisplayerText.clientHeight + 50 +'px';
el.querySelector('.o-crossword-user-answer').style.top = clueDisplayerText.clientHeight + 'px';
}

gridEl.style.marginTop = clueDisplayer.style.height;
} else {
for (let i = 0; i < gridTDs.length; i++) {
let td = gridTDs[i];
Expand All @@ -1098,6 +1100,7 @@ OCrossword.prototype.assemble = function assemble() {
let desktopSize = gridTDs[0].getBoundingClientRect().width;
inputEl.style.width = desktopSize + "px";
inputEl.style.height = desktopSize + "px";
gridEl.style.marginTop = "initial";
}

d2 = gridEl.getBoundingClientRect();
Expand Down
3 changes: 2 additions & 1 deletion src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@
}

.o-crossword-reset {
margin: 0 10px 20px;
margin: 20px 10px;
float: right;

@include oGridRespondTo(M) {
margin: 0;
Expand Down

0 comments on commit fad98ca

Please sign in to comment.