[FIX] mass_mailing: prevent selection change into zone outside snippets
When starting with an empty mailing, it was possible to click in the document and start typing, while this should not be allowed since that zone is not really editable. We want to only allow writing into snippets. task-2778412 closes odoo/odoo#85328 X-original-commit: c9ebe6996f61c24c2a67212beba5dcc95e9a7ed9 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -5,6 +5,25 @@ var Wysiwyg = require('web_editor.wysiwyg');
|
||||
var MassMailingSnippetsMenu = require('mass_mailing.snippets.editor');
|
||||
|
||||
const MassMailingWysiwyg = Wysiwyg.extend({
|
||||
//--------------------------------------------------------------------------
|
||||
// Public
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
start: async function () {
|
||||
const res = await this._super(...arguments);
|
||||
// Prevent selection change outside of snippets.
|
||||
this.$editable.on('mousedown', e => {
|
||||
if ($(e.target).is('.o_editable:empty') || e.target.querySelector('.o_editable')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
return res;
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Private
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user