mirror of https://github.com/OCA/web.git
[IMP] web_widget_ck_editor: pre-commit stuff
parent
97e1bdbb46
commit
16199d63a2
|
@ -0,0 +1 @@
|
||||||
|
../../../../web_widget_ckeditor
|
|
@ -0,0 +1,6 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
|
@ -89,7 +89,10 @@ odoo.define("web_widget_ckeditor.field_ckeditor", function (require) {
|
||||||
// Removing spaces & html spaces
|
// Removing spaces & html spaces
|
||||||
const value =
|
const value =
|
||||||
this.value &&
|
this.value &&
|
||||||
this.value.split(" ").join("").replace(/\s/g, "");
|
this.value
|
||||||
|
.split(" ")
|
||||||
|
.join("")
|
||||||
|
.replace(/\s/g, "");
|
||||||
return (
|
return (
|
||||||
value &&
|
value &&
|
||||||
value !== "<p></p>" &&
|
value !== "<p></p>" &&
|
||||||
|
@ -145,7 +148,7 @@ odoo.define("web_widget_ckeditor.field_ckeditor", function (require) {
|
||||||
try {
|
try {
|
||||||
const ckconfig = await getCKEditorConfigPromise;
|
const ckconfig = await getCKEditorConfigPromise;
|
||||||
if (ckconfig.toolbar) {
|
if (ckconfig.toolbar) {
|
||||||
return ckconfig.toolbar.split(/[\s,]+/).filter((item) => item);
|
return ckconfig.toolbar.split(/[\s,]+/).filter(item => item);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(
|
console.warn(
|
||||||
|
@ -250,7 +253,9 @@ odoo.define("web_widget_ckeditor.field_ckeditor", function (require) {
|
||||||
*/
|
*/
|
||||||
_renderEdit: function() {
|
_renderEdit: function() {
|
||||||
const value = this._textToHtml(this.value);
|
const value = this._textToHtml(this.value);
|
||||||
this.$target = $("<textarea>").val(value).hide();
|
this.$target = $("<textarea>")
|
||||||
|
.val(value)
|
||||||
|
.hide();
|
||||||
this.$target.appendTo(this.$el);
|
this.$target.appendTo(this.$el);
|
||||||
return this._createCKEditorIntance();
|
return this._createCKEditorIntance();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue