-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateLineData.js
More file actions
27 lines (24 loc) · 871 Bytes
/
createLineData.js
File metadata and controls
27 lines (24 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var electron = require('electron');
function createOption(selectObject, popupContent, indexValue) {
var option = document.createElement("option");
option.text = popupContent;
option.value = indexValue;
selectObject.add(option);
}
function onPageLoad() {
var x = document.getElementById('markers');
var markerNames = [];
electron.ipcRenderer.on('got-markers', (event, args) => {
markerNames = args;
for(i = 0; i < markerNames.length; i++) {
console.log(markerNames[i]);
createOption(x, markerNames[i], i);
}
});
electron.ipcRenderer.send('get-markers');
}
function updateOtherMarkerIndex() {
electron.ipcRenderer.send('save-marker-index', document.getElementById('markers').value);
}
window.onload = onPageLoad;
document.getElementById('markers').onchange = updateOtherMarkerIndex;