3 var Backbone = require('backbone');
4 var Marionette = require('backbone.marionette');
5 var context = require('gitter-web-client-context');
6 var template = require('./tmpl/chatInputView.hbs');
7 var ChatInputBoxView = require('./chat-input-box-view');
8 var ChatInputButtons = require('./chat-input-buttons');
10 require('../behaviors/isomorphic');
12 var ChatInputView = Marionette.LayoutView.extend({
18 chatInputBox: { el: '#chat-input-box-region', init: 'initChatInputBoxRegion' },
19 chatInputButtons: { el: '#chat-input-buttons-region', init: 'initChatInputButtonsRegion' }
24 chatInputBox: '#chat-input-box-region',
25 chatInputButtons: '#chat-input-buttons-region'
28 initialize: function() {
29 // clean up old compose mode persistence in the next event loop.
30 // Remove this by 1 December 2015
31 setTimeout(function() {
32 window.localStorage.removeItem('compose_mode_enabled');
35 this.composeMode = new Backbone.Model({ isComposeModeEnabled: false });
38 serializeData: function() {
39 return { user: context.user() };
42 initChatInputBoxRegion: function(optionsForRegion) {
43 return new ChatInputBoxView(
45 composeMode: this.composeMode,
46 collection: this.collection
51 initChatInputButtonsRegion: function(optionsForRegion) {
52 return new ChatInputButtons(
54 model: this.composeMode
60 module.exports = ChatInputView;