Skip to content

Commit

Permalink
Merge pull request #165 from NREL/GE-102
Browse files Browse the repository at this point in the history
config
  • Loading branch information
gh-23378 authored Aug 23, 2017
2 parents 008f53f + 66fe5a6 commit 3a7bd81
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ window.api = {
online: true,
initialGridSize: 50,
initialNorthAxis: 0,
defaultLocation: {
latitude: 39.7653,
longitude: -104.9863,
},
onChange: () => { window.versionNumber += 1; },
}, config);
},
Expand All @@ -54,9 +58,11 @@ window.api = {
window.application.$store.dispatch('project/setSpacing', { spacing: window.api.config.initialGridSize });
window.application.$store.dispatch('project/setNorthAxis', { north_axis: window.api.config.initialNorthAxis });

// if the map modal has been disabled, mark the map as initialized so that time travel can be initialized
// TODO: we may want to intitialize timetravel in the importFloorplan action instead
window.application.$store.dispatch('project/setMapInitialized', { initialized: true });
window.application.$store.dispatch('project/setMapEnabled', { enabled: window.api.config.showMapDialogOnStart });
window.application.$store.dispatch('project/setMapVisible', { visible: window.api.config.showMapDialogOnStart });

window.application.$store.dispatch('project/setMapLatitude', { latitude: window.api.config.defaultLocation.latitude });
window.application.$store.dispatch('project/setMapLongitude', { longitude: window.api.config.defaultLocation.longitude });

this.initAlreadyRun = true;
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/Modals/MapModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

<button @click="$refs.importInput.click()" id="import">Open Floorplan</button>
<button @click="mapEnabled = false; mapVisible = false; $emit('close')">New Floorplan</button>
<button @click="mapEnabled = true; tool='Map'; $emit('close')">New Floorplan w/ Map</button>
<button @click="mapEnabled = true; tool='Map'; $emit('close')" :disabled="!online">New Floorplan w/ Map</button>
<input ref="importInput" @change="importFloorplanAsFile" type="file"/>
</div>
</div>
Expand All @@ -36,6 +36,7 @@ export default {
};
},
computed: {
online () { return window.api && window.api.config ? window.api.config.online : true; },
mapEnabled: {
get() { return this.$store.state.project.map.enabled; },
set(enabled) {
Expand Down
4 changes: 4 additions & 0 deletions src/scss/partials/inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ button {
height: 2rem;
outline: none;
padding: 0 .75rem;
&[disabled] {
cursor: not-allowed;
background-color: $gray-medium-dark;
}
}

0 comments on commit 3a7bd81

Please sign in to comment.