Skip to content

Commit

Permalink
Quick fix to enforce removal of canvas from page on mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaburke91 committed Sep 6, 2017
1 parent b89970e commit 7674e5e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ga('create', 'UA-6061419-3', 'auto');

function setupRadioPlayer() {
const width = window.innerWidth;
const isMobile = width <= 500;
const isMobile = width <= 767;

let audioElement = document.getElementById('nts-player-audio');
let radioIsPlaying = false;
Expand Down Expand Up @@ -103,9 +103,13 @@ function setupRadioPlayer() {
setInterval(handleRadioTextDisplay, 5000);
}


$(document).ready(function() {
// ga('send', 'pageview', window.location.pathname); // FIXME unncomment for live!!!

setupRadioPlayer();

const isMobile = window.innerWidth <= 767;
if (isMobile) {
$('canvas').remove();
}
});
2 changes: 1 addition & 1 deletion public/js/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion react/Collage/Collage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Collage extends React.Component {
window.addEventListener('resize', resizeCanvas, false);

function resizeCanvas() {
if (window.innerWidth <= 500) return;
if (window.innerWidth <= 767) return;

that.canvas.setHeight(window.innerHeight);
that.canvas.setWidth(window.innerWidth);
Expand Down
2 changes: 1 addition & 1 deletion react/react-index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class App extends React.Component {

render() {
const width = this.state.windowWidth;
const isMobile = width <= 500;
const isMobile = width <= 767;

if (isMobile) {
console.log("isMobile");
Expand Down

0 comments on commit 7674e5e

Please sign in to comment.