mcopy/app/lib/ui/devices.js

29 lines
536 B
JavaScript
Raw Normal View History

2016-06-19 00:15:41 +00:00
var devices = {};
devices.init = function () {
'use strict';
devices.listen();
gui.overlay(true);
gui.spinner(true);
};
devices.listen = function () {
'use strict';
ipcRenderer.on('ready', devices.ready);
2016-06-19 00:15:41 +00:00
};
devices.ready = function (event, arg) {
2016-06-19 00:15:41 +00:00
'use strict';
let opt;
2016-06-19 00:15:41 +00:00
gui.spinner(false);
gui.overlay(false);
for (let i in arg) {
opt = $('<option>');
opt.val(arg[i]);
opt.text(arg[i]);
$(`#${i}_device`).empty();
$(`#${i}_device`).append(opt);
}
return event.returnValue = true;
2016-06-19 00:15:41 +00:00
};
module.exports = devices;