Extract narrow_state.js.

Despite the length of this commit, it is a very straightforward
moving of code from narrow.js -> narrow_state.js, and then
everything else is just s/narrow.foo()/narrow_state.foo()/
(with a few tiny cleanups to remove some code duplication
in certain callers).

The only new functions are simple setter/getters that
encapsulate the current_filter variable:

    narrow_state.reset_current_filter()
    narrow_state.set_current_filter()
    narrow_state.get_current_filter()

We removed narrow.predicate() as part of this, since it was dead
code.

Also, we removed the shim for narrow_state.set_compose_defaults(),
and since that was the last shim, we removed shim.js from the app.
This commit is contained in:
Steve Howell
2017-04-25 06:25:31 -07:00
committed by Tim Abbott
parent 7326971380
commit 8eb86335b9
30 changed files with 342 additions and 321 deletions

View File

@@ -140,6 +140,7 @@ def find_edges_to_remove(graph, methods):
('settings_notifications', 'stream_edit'),
('compose', 'stream_edit'),
('subs', 'stream_edit'),
('narrow_state', 'stream_data'),
] # type: List[Edge]
def is_exempt(edge):