Add shim.js w/narrow_state global.

This commit is contained in:
Steve Howell 2017-03-18 08:59:32 -07:00 committed by Tim Abbott
parent 68e7a8a824
commit 35d38d62f3
4 changed files with 13 additions and 1 deletions

View File

@ -71,6 +71,7 @@
"stream_list": false,
"stream_popover": false,
"narrow": false,
"narrow_state": false,
"admin": false,
"stream_data": false,
"muting": false,

View File

@ -195,7 +195,7 @@ function fill_in_opts_from_current_narrowed_view(msg_type, opts) {
};
// Set default parameters based on the current narrowed view.
narrow.set_compose_defaults(default_opts);
narrow_state.set_compose_defaults(default_opts);
opts = _.extend(default_opts, opts);
return opts;
}

10
static/js/shim.js Normal file
View File

@ -0,0 +1,10 @@
/*
This module has shims to help us break circular dependencies.
We eventually want to to move the actual implementations into
new modules. When we do this, you may need to fix node tests
that still refer to the old name.
*/
var narrow_state = {}; // global, should be made into module
narrow_state.set_compose_defaults = narrow.set_compose_defaults;

View File

@ -893,6 +893,7 @@ JS_SPECS = {
'js/bot_data.js',
'js/reactions.js',
'js/typing.js',
'js/shim.js',
# JS bundled by webpack is also included here if PIPELINE_ENABLED setting is true
],
'output_filename': 'min/app.js'