Consolidate code for narrow/compose interactions.

This commit extracts the method compose_actions.on_narrow()
to handle changing the compose box (as appropriate) after
any narrowing action.

This change should be mostly non-user-facing, but it's not
exactly a trivial extraction.

For the case where the user already had content in their
compose box, we continue to leave the compose box alone,
but we now update compose fading 150+ lines later in
narrow.activate().

Likewise, for cases where we cancel composing, this will
also happen later in the function.

Finally, for PM narrows, where we auto-open the compose box, we
no longer call compose.cancel() before calling compose.start(),
because either a) the compose box would have not been open
in the first place or b) the start() function can handle
clearing the old fields.
This commit is contained in:
Steve Howell
2017-04-16 07:48:31 -07:00
committed by Tim Abbott
parent 55bea73035
commit c7a9a02667
3 changed files with 18 additions and 13 deletions

View File

@@ -173,6 +173,7 @@ def find_edges_to_remove(graph, methods):
('compose', 'compose_actions'),
('compose', 'subs'),
('compose_actions', 'drafts'),
('compose_actions', 'narrow'),
('compose_actions', 'unread_ops'),
('drafts', 'compose'),
('drafts', 'echo'),