Skip to content

Commit

Permalink
[ADD] review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gfcapalbo committed May 2, 2022
1 parent 8bfe243 commit de8f398
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
30 changes: 15 additions & 15 deletions web_widget_html_markdown/static/src/js/web_widget_html_markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ odoo.define("web_widget_html_markdown.FieldHtmlMarkDown", function(require) {
// we use recursion (max1)!
return self.commitChanges()
});
} else {
var _super = this._super.bind(this);
// we must setvalue with force change.
// or it won't pick up changes in the
// switch: USECASE: we modify in MD, then switch to HTML, then save.
// to refresh the Wysiwyg in case we are coming from
// markdown and no changes have been made in HTML
// (debounce widget considers this case as "Unedited" and does not save).
this._setValue(this.value, {forceChange: true});
return this.wysiwyg.saveModifiedImages(this.$content).then(function () {
return self.wysiwyg.save(self.nodeOptions).then(function (result) {
self._isDirty = true;
_super();
});
});
} else (self.mode == 'edit') {
var _super = this._super.bind(this);
// we must setvalue with force change.
// or it won't pick up changes in the
// switch: USECASE: we modify in MD, then switch to HTML, then save.
// to refresh the Wysiwyg in case we are coming from
// markdown and no changes have been made in HTML
// (debounce widget considers this case as "Unedited" and does not save).
this._setValue(this.value, {forceChange: true});
return this.wysiwyg.saveModifiedImages(this.$content).then(function () {
return self.wysiwyg.save(self.nodeOptions).then(function (result) {
self._isDirty = true;
_super();
});
});
}
},
/**
Expand Down
4 changes: 1 addition & 3 deletions web_widget_html_markdown/views/assets.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- * Copyright 2014 Sudokeys <http://www.sudokeys.com>
* Copyright 2017 Komit - <http:///komit-consulting.com>
* Copyright 2019 Alexandre Díaz - <[email protected]>
<!-- * Copyright 2022 therp B.V. <http://www.therp.nl>
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).-->
<odoo>
<template
Expand Down

0 comments on commit de8f398

Please sign in to comment.