summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-01-16 13:53:03 +0100
committerChristophe Matthieu <chm@odoo.com>2015-01-16 16:38:10 +0100
commitce1ed62676226846edd76d0f3917f08b014506fc (patch)
tree68fee5d97745fa1ab617204c30b7c3d6cb42868d /addons/website/static/src/js/website.editor.js
parent23a6b2f3e36dfa1d10bde3a7638555153b9b4383 (diff)
[FIX] website editor: Issues with link dialog. After changing style one button from the modal, all its right sibling buttons are dis-appeared.; delete content of the range is wrong
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 1f22e532c23..05f07b382a0 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -357,15 +357,24 @@ define(['summernote/summernote'], function () {
};
eventHandler.dialog.showLinkDialog = function ($editable, $dialog, linkInfo) {
+ $editable.data('range').select();
+ $editable.data('NoteHistory').recordUndo();
+
var editor = new website.editor.LinkDialog($editable, linkInfo);
editor.appendTo(document.body);
var def = new $.Deferred();
editor.on("save", this, function (linkInfo) {
+ linkInfo.range.select();
+ $editable.data('range', linkInfo.range);
def.resolve(linkInfo);
+ $editable.data('NoteHistory').popUndo();
$('.note-popover .note-link-popover').show();
});
- editor.on("cancel", this, function () { def.reject(); });
+ editor.on("cancel", this, function () {
+ def.reject();
+ $editable.data('NoteHistory').popUndo();
+ });
return def;
};
eventHandler.dialog.showImageDialog = function ($editable) {
@@ -806,6 +815,7 @@ define(['summernote/summernote'], function () {
};
this.popUndo = function () {
+ pos--;
aUndo.pop();
};