Moved the dialog to prevent interference with the dialog's maintainFocus()
authorAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jan 2020 19:43:29 +0000 (20:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jan 2020 19:43:29 +0000 (20:43 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabLink.js

index 6805cbef00d8272ac3b213b8f29461686b01790e..e975bd912321a61a626dda6947185d3d37ed8cf1 100644 (file)
@@ -79,6 +79,13 @@ $.Redactor.prototype.WoltLabLink = function() {
                        // is link
                        var $el = this.link.is();
                        
+                       // build link
+                       if (hasSelectedText) this.selection.restore();
+                       
+                       var link = this.link.buildLinkFromElement($el);
+                       
+                       if (hasSelectedText) this.selection.save();
+
                        // WoltLab START
                        // this.link.buildModal($el);
                        _dialogApi.showDialog({
@@ -100,13 +107,6 @@ $.Redactor.prototype.WoltLabLink = function() {
                        });
                        // WoltLab END
                        
-                       // build link
-                       if (hasSelectedText) this.selection.restore();
-                       
-                       var link = this.link.buildLinkFromElement($el);
-                       
-                       if (hasSelectedText) this.selection.save();
-                       
                        // if link cut & paste inside editor browser added self host to a link
                        link.url = this.link.removeSelfHostFromUrl(link.url);