Fixed up some css and check restoring
This commit is contained in:
19
MMM-todo.css
19
MMM-todo.css
@ -3,12 +3,11 @@
|
||||
}
|
||||
|
||||
/* Customize the label (the container) */
|
||||
.container {
|
||||
.MMM-todo .todo-container {
|
||||
display: block;
|
||||
position: relative;
|
||||
padding-left: 35px;
|
||||
margin-bottom: 12px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 6px;
|
||||
font-size: 22px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
@ -17,7 +16,7 @@
|
||||
}
|
||||
|
||||
/* Hide the browser's default checkbox */
|
||||
.container input {
|
||||
.MMM-todo .todo-container input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
@ -26,7 +25,7 @@
|
||||
}
|
||||
|
||||
/* Create a custom checkbox */
|
||||
.checkmark {
|
||||
.MMM-todo .checkmark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@ -36,29 +35,29 @@
|
||||
}
|
||||
|
||||
/* On mouse-over, add a grey background color */
|
||||
.container:hover input ~ .checkmark {
|
||||
.MMM-todo .todo-container:hover input ~ .checkmark {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
/* When the checkbox is checked, add a blue background */
|
||||
.container input:checked ~ .checkmark {
|
||||
.MMM-todo .todo-container input:checked ~ .checkmark {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
/* Create the checkmark/indicator (hidden when not checked) */
|
||||
.checkmark:after {
|
||||
.MMM-todo .checkmark:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show the checkmark when checked */
|
||||
.container input:checked ~ .checkmark:after {
|
||||
.MMM-todo .todo-container input:checked ~ .checkmark:after {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Style the checkmark/indicator */
|
||||
.container .checkmark:after {
|
||||
.MMM-todo .todo-container .checkmark:after {
|
||||
left: 9px;
|
||||
top: 5px;
|
||||
width: 5px;
|
||||
|
@ -60,7 +60,7 @@ Module.register("MMM-todo", {
|
||||
|
||||
getCheckbox: function(label, id) {
|
||||
var container = document.createElement("label")
|
||||
container.className = "container"
|
||||
container.className = "todo-container"
|
||||
container.innerText = label
|
||||
|
||||
var cb = document.createElement("input")
|
||||
@ -68,11 +68,11 @@ Module.register("MMM-todo", {
|
||||
if (id !== undefined) {
|
||||
cb.id = id
|
||||
}
|
||||
if (localStorage.getItem(cb.id)) {
|
||||
if (parseInt(localStorage.getItem(cb.id), 10)) {
|
||||
cb.checked = true
|
||||
}
|
||||
cb.onclick = function(ev) {
|
||||
localStorage.setItem(ev.target.id, cb.checked)
|
||||
localStorage.setItem(ev.target.id, cb.checked ? 1 : 0)
|
||||
}
|
||||
|
||||
var cm = document.createElement("span")
|
||||
|
Reference in New Issue
Block a user