Skip to content

Commit

Permalink
Mithril-ize waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs224 committed Feb 3, 2018
1 parent cd3877b commit 43c3401
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
13 changes: 1 addition & 12 deletions main/index.html
Expand Up @@ -17,18 +17,7 @@
<!-- <div class="airspeed"></div>
<div class="altimeter"></div> -->
</div>
<div id="waypoints">
<div class="waypoint">1</div>
<div class="waypoint">2</div>
<div class="waypoint">3</div>
<div class="waypoint">4</div>
<div class="waypoint">5</div>
<div class="waypoint">6</div>
<div class="waypoint">7</div>
<div class="waypoint">8</div>
<div class="waypoint">9</div>
<div class="waypoint">10</div>
</div>
<div id="waypoints"></div>
</div>
<script src="../dist/bundle.js"></script>
</body>
Expand Down
5 changes: 4 additions & 1 deletion src/app.js
Expand Up @@ -5,6 +5,7 @@ require("./components/map");
var { ipcRenderer } = require("electron");
var state = require("./state");
var m = require("mithril");
var Waypoints = require('./components/waypoints');

m.render($('.buttons')[0], [
m('button', {
Expand All @@ -22,4 +23,6 @@ m.render($('.buttons')[0], [
ipcRenderer.send("sendCommand", 20);
}
}, 'Return to Launch'),
]);
]);

m.mount($('#waypoints')[0], Waypoints);
19 changes: 19 additions & 0 deletions src/components/waypoints.js
@@ -0,0 +1,19 @@
var m = require("mithril");

var Waypoints = {
view() {
return [
m('div', {class: 'waypoint'}, '1'),
m('div', {class: 'waypoint'}, '2'),
m('div', {class: 'waypoint'}, '3'),
m('div', {class: 'waypoint'}, '4'),
m('div', {class: 'waypoint'}, '5'),
m('div', {class: 'waypoint'}, '6'),
m('div', {class: 'waypoint'}, '7'),
m('div', {class: 'waypoint'}, '8'),
m('div', {class: 'waypoint'}, '9'),
];
}
}

module.exports = Waypoints;

0 comments on commit 43c3401

Please sign in to comment.