diff --git a/src/view/modals.py b/src/view/modals.py index 06d2a43..096be85 100644 --- a/src/view/modals.py +++ b/src/view/modals.py @@ -54,17 +54,16 @@ def edit_example(example, sense): h("span.example-component-button.example-component-collocate", {"on": {"click": role_msg(idx, "collocate")}}, "C"), h("span.example-component-button.example-component-other", - {"on": {"click": role_msg(idx, "other")}}, "O"), - h("span.example-component-button.example-component-none", - {"on": {"click": role_msg(idx, "none")}}, "N")] - + {"on": {"click": role_msg(idx, "other")}}, "O")] + if example.is_multiword(): additional_class = ".example-component-no-space" if component.no_space else "" + click_message = message.msg(message.ExampleComponentSpace, example_original, idx) result.append(h("span.example-component-button" + additional_class, - {"on": - {"click": - message.msg(message.ExampleComponentSpace, example_original, idx)}}, - "␣")) + {"on": {"click": click_message }}, "␣")) + else: + result.append(h("span.example-component-button.example-component-none", + {"on": {"click": role_msg(idx, "none")}}, "N")) result.extend([ h("span.example-component-button",