From db555ce0c7ffdc0fab1558bc3620d1b9a4f6cce8 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 31 Jul 2016 21:56:57 +0200 Subject: [PATCH] Fixed a few selection issues --- .../files/js/3rdParty/redactor2/plugins/WoltLabImage.js | 3 +++ .../files/js/3rdParty/redactor2/plugins/WoltLabLink.js | 4 +++- .../files/js/3rdParty/redactor2/plugins/WoltLabModal.js | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js index e48ef1ffae..7d8f837447 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js @@ -154,6 +154,9 @@ $.Redactor.prototype.WoltLabImage = function() { } this.modal.close(); + + this.buffer.set(); + this.insert.html(html); } }; diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabLink.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabLink.js index d2f6c61602..c7a5f7da1e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabLink.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabLink.js @@ -19,6 +19,8 @@ $.Redactor.prototype.WoltLabLink = function() { e.preventDefault(); } + this.selection.save(); + // close tooltip this.observe.closeAllTooltip(); @@ -36,7 +38,7 @@ $.Redactor.prototype.WoltLabLink = function() { return false; } - this.selection.restore(); + //this.selection.restore(); // insert or update this.link.insert(link, true); diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabModal.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabModal.js index c41f06c1ec..4374a499ec 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabModal.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabModal.js @@ -10,6 +10,8 @@ $.Redactor.prototype.WoltLabModal = function() { // need to go there nor will it work var _methods = { close: function() { + this.selection.restore(); + _uiDialog.close(this); }, -- 2.20.1