|
@@ -2480,9 +2480,10 @@
|
|
|
});
|
|
|
|
|
|
this.ChatBoxViews = Backbone.View.extend({
|
|
|
- el: '#conversejs',
|
|
|
|
|
|
initialize: function () {
|
|
|
+ this.render();
|
|
|
+
|
|
|
var views = {};
|
|
|
this.get = function (id) { return views[id]; };
|
|
|
this.set = function (id, view) { views[id] = view; };
|
|
@@ -2509,6 +2510,23 @@
|
|
|
}, this);
|
|
|
},
|
|
|
|
|
|
+ render: function () {
|
|
|
+ this.$el.html(converse.templates.trimmed_chats());
|
|
|
+ },
|
|
|
+
|
|
|
+ _ensureElement: function() {
|
|
|
+ if (!this.el) {
|
|
|
+ var $el = $('#conversejs');
|
|
|
+ if (!$el.length) {
|
|
|
+ $el = $('<div id="conversejs">');
|
|
|
+ $('body').append($el);
|
|
|
+ }
|
|
|
+ this.setElement($el, false);
|
|
|
+ } else {
|
|
|
+ this.setElement(_.result(this, 'el'), false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
trimOpenChats: function (view) {
|
|
|
/* This method is called before a new chat box will be opened.
|
|
|
*
|
|
@@ -2964,32 +2982,6 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- this.TrimmedChatBoxes = Backbone.View.extend({
|
|
|
- /* A view for trimmed chat boxes and chat rooms.
|
|
|
- * XXX: Add this view inside ChatBoxViews's $el (i.e. #conversejs)
|
|
|
- */
|
|
|
- tagName: 'div',
|
|
|
- id: 'trimmed-chatboxes',
|
|
|
- initialize: function () {
|
|
|
- var views = {};
|
|
|
- this.get = function (id) { return views[id]; };
|
|
|
- this.set = function (id, view) { views[id] = view; };
|
|
|
- this.getAll = function () { return views; };
|
|
|
-
|
|
|
- this.$el.html(converse.templates.trimmed_chats());
|
|
|
- this.model.on("add", function (item) {
|
|
|
- if (!item.get('trimmed')) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.show(item);
|
|
|
- }, this);
|
|
|
- },
|
|
|
-
|
|
|
- show: function (item) {
|
|
|
- this.$('.box-flyout').append(converse.templates.trim_chat());
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
this.RosterView = Backbone.View.extend({
|
|
|
tagName: 'dl',
|
|
|
id: 'converse-roster',
|