Skip to content

Commit

Permalink
Fullscreen button fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
felicien-brochu committed Nov 8, 2016
1 parent fcaefd0 commit b3bb29f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
.gog-ic-pause {
display: none;
}
.gog-ic-fullscreen-exit {
display: none;
}
#gog-bottom-action-buttons {
position: absolute;
right: 0;
Expand All @@ -91,8 +94,8 @@
width: 46px;
}
#gog-fullscreen-button svg {
width: 30;
height: 30;
width: 30px;
height: 30px;
}
#gog-bottom-action-buttons .gog-action-button.gog-small {
width: 34px;
Expand Down
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
<svg><use xlink:href="svg/sprite.svg#shape-ic-tutorial"></use></svg>
</button></li>
<li><button id="gog-fullscreen-button" class="gog-action-button">
<svg><use xlink:href="svg/sprite.svg#shape-ic-fullscreen"></use></svg>
<svg class="gog-ic-fullscreen"><use xlink:href="svg/sprite.svg#shape-ic-fullscreen"></use></svg>
<svg class="gog-ic-fullscreen-exit"><use xlink:href="svg/sprite.svg#shape-ic-fullscreen-exit"></use></svg>
</button></li>
</ul>

Expand Down
9 changes: 7 additions & 2 deletions src/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,15 @@ Settings.prototype.onFullscreenButtonMouseDown = function() {
}

Settings.prototype.onFullscreenChange = function() {
var fullscreenIcon = this.fullscreenButton.getElementsByClassName("gog-ic-fullscreen")[0];
var fullscreenExitIcon = this.fullscreenButton.getElementsByClassName("gog-ic-fullscreen-exit")[0];

if (getFullscreenElement()) {
this.fullscreenButton.childNodes[0].childNodes[0].setAttribute("xlink:href", "svg/sprite.svg#shape-ic-fullscreen-exit");
fullscreenIcon.style.display = "none";
fullscreenExitIcon.style.display = "inline-block";
} else {
this.fullscreenButton.childNodes[0].childNodes[0].setAttribute("xlink:href", "svg/sprite.svg#shape-ic-fullscreen");
fullscreenIcon.style.display = "inline-block";
fullscreenExitIcon.style.display = "none";
}
}

Expand Down

0 comments on commit b3bb29f

Please sign in to comment.