3 var Marionette = require('backbone.marionette');
4 var ModalView = require('./modal');
5 var context = require('gitter-web-client-context');
6 var template = require('./tmpl/welcome-message-view.hbs');
7 var apiClient = require('../../components/api-client');
9 var View = Marionette.ItemView.extend({
12 welcomeMessage: '#welcome-message-container'
15 initialize: function() {
16 this.listenTo(this, 'menuItemClicked', this.menuItemClicked, this);
19 menuItemClicked: function(type) {
22 apiClient.user.post('/rooms', { id: context.troupe().id }).then(
24 context.setTroupe(body);
25 this.destroyWelcomeMessage();
32 onRender: function() {
33 apiClient.room.get('/meta').then(
34 function(roomMetadata) {
35 this.ui.welcomeMessage.html(roomMetadata.welcomeMessage.html);
40 destroyWelcomeMessage: function() {
46 var Modal = ModalView.extend({
47 initialize: function(attrs, options) {
48 ModalView.prototype.initialize.call(this, options, attrs);
49 this.view = new View(attrs, options);
56 className: 'modal--default__footer__btn'