todo_widget: Fix /todo checkboxes to match style used in menus.

Fixes #20212
This commit is contained in:
Manan Rathi 2021-11-12 10:36:57 +05:30 committed by Tim Abbott
parent 7df5f8e6f5
commit f3469ac3c8
3 changed files with 13 additions and 9 deletions

View File

@ -191,7 +191,7 @@ export function activate(opts) {
elem.find("ul.todo-widget").html(html);
elem.find(".widget-error").text("");
elem.find("button.task").on("click", (e) => {
elem.find("input.task").on("click", (e) => {
e.stopPropagation();
const key = $(e.target).attr("data-key");

View File

@ -6,6 +6,6 @@
<button class="add-task">{{t "Add task" }}</button>
<div class="widget-error"></div>
</div>
<ul class="todo-widget">
<ul class="todo-widget new-style">
</ul>
</div>

View File

@ -1,16 +1,20 @@
<br />
{{#each pending_tasks}}
<li>
<button class="task" data-key="{{ key }}">
</button>
<span class="task"><strong>{{ task }}</strong>{{#if desc }} - {{ desc }}{{/if}}</span>
<label class="checkbox">
<input type="checkbox" class="task" data-key="{{ key }}" />
<span></span>
<strong>{{ task }}</strong>{{#if desc }} - {{ desc }}{{/if}}
</label>
</li>
{{/each}}
{{#each completed_tasks}}
<li>
<button class="task-completed task" data-key="{{ key }}">
<img class="task-completed" src="/static/images/checkbox-green.svg" data-key="{{ key }}"/>
</button>
<span class="task"><strike><em><strong>{{ task }}</strong>{{#if desc }} - {{ desc }}{{/if}}</em></strike></span>
<label class="checkbox">
<input type="checkbox" class="task" data-key="{{ key }}" checked="checked"/>
<span></span>
<strike><em><strong>{{ task }}</strong>{{#if desc }} - {{ desc }}{{/if}}</em></strike>
</label>
</li>
{{/each}}