[FIX] portal: dynamic chatter not editable
60c920d4ashould solve duplication of chatter when editing the website. But portal module doesn't depends on website, so eg. on a instance with just helpdesk (and no website) we would not see the chatter on the frontend. This fix reverts60c920d4aand adds another solution not depending on website. opw-1813792 closes #23614
This commit is contained in:
@@ -5,7 +5,6 @@ var base = require('web_editor.base');
|
||||
var ajax = require('web.ajax');
|
||||
var core = require('web.core');
|
||||
var Widget = require('web.Widget');
|
||||
var sAnimation = require('website.content.snippets.animation');
|
||||
var rpc = require('web.rpc');
|
||||
var time = require('web.time');
|
||||
|
||||
@@ -223,19 +222,12 @@ var PortalChatter = Widget.extend({
|
||||
},
|
||||
});
|
||||
|
||||
sAnimation.registry.portal_chatter = sAnimation.Class.extend({
|
||||
selector: ".o_portal_chatter",
|
||||
destroy: function () {
|
||||
this.$target.empty();
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
start: function () {
|
||||
if (!this.editableMode) {
|
||||
var mail_thread = new PortalChatter(null, this.$el.data());
|
||||
mail_thread.appendTo(this.$el);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
base.ready().then(function () {
|
||||
$('.o_portal_chatter').each(function (index) {
|
||||
var $elem = $(this);
|
||||
var mail_thread = new PortalChatter(null, $elem.data());
|
||||
mail_thread.appendTo($elem);
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
the message will be posted with the identity of the partner_id of the object
|
||||
-->
|
||||
<template id="message_thread">
|
||||
<div id="discussion" class="hidden-print o_portal_chatter"
|
||||
<div id="discussion" class="hidden-print o_portal_chatter o_not_editable"
|
||||
t-att-data-token="token" t-att-data-res_model="object._name" t-att-data-res_id="object.id" t-att-data-pager_step="message_per_page or 10" t-att-data-allow_composer="'0' if disable_composer else '1'">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user