Commit 01ca0c96 authored by alain's avatar alain 🐙
Browse files

fix panel breakpoint

parent 32dd7c39
......@@ -3,6 +3,8 @@ import React from 'react'
import { connect } from 'react-redux'
import { setPanelStatus } from "../actions"
import { appSettings } from "../../../config/app"
import ReactHtmlParser from 'react-html-parser'
import IconArrowDown from "../Icons/IconArrowDown"
......@@ -13,7 +15,7 @@ class Panel extends React.Component {
componentDidMount() {
const { id, openOnLoad } = this.props
if(openOnLoad && window.innerHeight > 800) {
if(openOnLoad && document.getElementById('root').offsetHeight > appSettings.panelBreakpoint) {
const change = {}
change[id] = true
......
......@@ -3,6 +3,8 @@ import React from 'react'
import { connect } from 'react-redux'
import { setPanelStatus, setUnitStatus } from "../actions"
import { appSettings } from "../../../config/app"
import { inArray } from "../util/data.js"
import Panel from './Panel'
......@@ -25,7 +27,7 @@ class PanelLayers extends React.Component {
unitStatus = {}
dataGroups.forEach((dataGroup, i) => {
panelStatus[dataGroup.title] = (i === 0 && window.innerHeight > 800 ? true : false)
panelStatus[dataGroup.title] = (i === 0 && document.getElementById('root').offsetHeight > appSettings.panelBreakpoint ? true : false)
Object.keys(dataGroup.parameters).forEach(parameter => {
if(dataGroup.parameters[parameter].units) {
......@@ -79,7 +81,7 @@ class PanelLayers extends React.Component {
return (
<li key={option} className={(active ? "active" : "")}>
<span className="parameter-title" onClick={() => {
if(!active && viewportHeight < 800) {
if(!active && viewportHeight < appSettings.panelBreakpoint) {
setTimeout(() => {
this.toggleGroup(dataGroup.title)
}, 500);
......
......@@ -50,7 +50,6 @@ class App extends React.Component {
deckLayers: {},
data: null,
layers: initialLayers,
//loaded: 0,
loading: 0,
loadingError: false,
modalContent: null
......@@ -120,11 +119,6 @@ class App extends React.Component {
loadingError: true
})
} else {
// const previousData = []
// Object.keys(deckLayers[layer]).forEach(source => {
// if(deckLayers[layer][source].data) previousData.push(deckLayers[layer][source].data)
// })
deckLayers[layer][source.name] = {
layerDefinition,
source,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment