apple2js/js/ui/drive_lights.js
Will Scullin afc5280ac2
Flesh out some state stuff (#59)
Get save and restore state limping along to nearly as well as before I refactored and broke everything.
2021-02-27 19:17:36 -08:00

21 lines
678 B
JavaScript

export default function DriveLights()
{
return {
driveLight: function(drive, on) {
var disk = document.querySelector('#disk' + drive);
disk.style.backgroundImage =
on ? 'url(css/red-on-16.png)' :
'url(css/red-off-16.png)';
},
dirty: function() {
// document.querySelector('#disksave' + drive).disabled = !dirty;
},
label: function(drive, label) {
if (label) {
document.querySelector('#disk-label' + drive).innerText = label;
}
return document.querySelector('#disk-label' + drive).innerText;
}
};
}