| 59 | } |
| 60 | |
| 61 | buildTreema () { |
| 62 | if ((this.treema != null) || (!this.chat.loaded)) { return } |
| 63 | const data = $.extend(true, {}, this.chat.attributes) |
| 64 | const options = { |
| 65 | data, |
| 66 | filePath: `db/chat_message/${this.chat.get('_id')}`, |
| 67 | schema: ChatMessage.schema, |
| 68 | readOnly: me.get('anonymous'), |
| 69 | supermodel: this.supermodel |
| 70 | } |
| 71 | this.treema = this.$el.find('#chat-treema').treema(options) |
| 72 | this.treema.build() |
| 73 | if (this.treema.childrenTreemas.message != null) { |
| 74 | this.treema.childrenTreemas.message.open(2) |
| 75 | } |
| 76 | if (this.treema.childrenTreemas.context != null) { |
| 77 | this.treema.childrenTreemas.context.open(2) |
| 78 | } |
| 79 | __guard__(this.treema.childrenTreemas.context != null ? this.treema.childrenTreemas.context.childrenTreemas.i18n : undefined, x => x.close()) |
| 80 | return __guard__(this.treema.childrenTreemas.context != null ? this.treema.childrenTreemas.context.childrenTreemas.apiProperties : undefined, x1 => x1.close()) |
| 81 | } |
| 82 | |
| 83 | afterRender () { |
| 84 | let left |