summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/editor.js')
-rw-r--r--addons/web_editor/static/src/js/editor.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/addons/web_editor/static/src/js/editor.js b/addons/web_editor/static/src/js/editor.js
index 88d86bc825b..9e842bed4bc 100644
--- a/addons/web_editor/static/src/js/editor.js
+++ b/addons/web_editor/static/src/js/editor.js
@@ -63,9 +63,9 @@ editor.Class = Widget.extend({
template: 'web_editor.editorbar',
events: {
'click button[data-action=save]': 'save',
- 'click a[data-action=cancel]': 'cancel',
+ 'click button[data-action=cancel]': 'cancel',
},
- init: function(parent) {
+ init: function (parent) {
var self = this;
var res = this._super.apply(this, arguments);
this.parent = parent;
@@ -75,7 +75,7 @@ editor.Class = Widget.extend({
});
return res;
},
- start: function() {
+ start: function () {
var self = this;
$('.dropdown-toggle').dropdown();
@@ -86,14 +86,13 @@ editor.Class = Widget.extend({
this.rte.start();
var flag = false;
- window.onbeforeunload = function(event) {
+ window.onbeforeunload = function (event) {
if (rte.history.getEditableHasUndo().length && !flag) {
flag = true;
setTimeout(function () {flag=false;},0);
return _t('This document is not saved!');
}
};
- this.$('button[data-action="save"]').prop('disabled', true);
return this._super();
},
display_placeholder: function () {
@@ -119,9 +118,7 @@ editor.Class = Widget.extend({
}
});
},
- rte_changed: function () {
- this.$('button[data-action=save]').prop('disabled', !rte.history.getEditableHasUndo().length);
- },
+ rte_changed: function () {},
save: function () {
return this.rte.save().then(function () {
editor.reload();