8000 simplify example · Nullinteger65/pyscript@40c58c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 40c58c3

Browse files
committed
simplify example
1 parent 019b7d1 commit 40c58c3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pyscriptjs/examples/todo-pylist.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="viewport" content="width=device-width,initial-scale=1" />
65

76
<title>Todo App</title>
87

@@ -14,25 +13,23 @@
1413
- paths:
1514
- /utils.py
1615
</py-env>
17-
<py-register-widget src="/pylist.py" name="py-list" klass="PyList"></py-widget>
16+
<py-register-widget src="/pylist.py" name="py-list" klass="PyList"></py-register-widget>
1817
</head>
1918

2019
<body>
2120
<py-title>To Do List</py-title>
22-
<py-box widths="2/3;1/3">
21+
<py-box widths="4/5;1/5">
2322
<py-inputbox id="new-task-content">
2423
def on_keypress(e):
2524
if (e.code == "Enter"):
2625
add_task()
2726
</py-inputbox>
2827
<py-button id="new-task-btn" label="Add Task!">
2928
def on_click(evt):
30-
task = { "content": new_task_content.value, "done": False, "created_at": dt.now() }
31-
myList.add(PyItem(task, labels=['content'], state_key="done"))
32-
new_task_content.clear()
29+
add_task()
3330
</button>
3431
</py-box>
35-
32+
3633
<py-list id="myList"></py-list>
3734
<py-repl id="my-repl" auto-generate="true"> </py-repl>
3835
</body>

0 commit comments

Comments
 (0)
0