3 var $ = require('jquery');
4 var context = require('gitter-web-client-context');
5 var appEvents = require('../../utils/appevents');
6 var ChatLayout = require('./chat');
7 var HeaderView = require('../app/headerView');
8 var rightToolbarModel = require('../../models/right-toolbar-model');
9 var RightToolbarView = require('../righttoolbar/rightToolbarView');
11 require('../behaviors/isomorphic');
13 module.exports = ChatLayout.extend({
15 'click .chat-input-nli a[href^="/login"]': 'clickLogin'
18 clickLogin: function(e) {
20 var href = $(e.currentTarget).attr('href');
21 var route = 'login' + href.slice(href.indexOf('?'));
22 appEvents.trigger('loginClicked', route);
28 el: '#content-wrapper',
29 init: 'initChatRegion' // Declared in super
32 el: '#right-toolbar-layout',
33 init: 'initToolbarRegion'
36 el: '#header-wrapper',
37 init: 'initHeaderRegion'
42 initToolbarRegion: function(optionsForRegion) {
43 return new RightToolbarView(
45 model: rightToolbarModel
50 initHeaderRegion: function(optionsForRegion) {
51 return new HeaderView(
53 model: context.troupe()