From: Alexander Ebert Date: Thu, 19 Nov 2020 15:56:12 +0000 (+0100) Subject: Skip DOM updates when the article is not present X-Git-Tag: 5.3.1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=081df946c619ce1ccfd8009f7ea38b9ec5f8d05b;p=GitHub%2FWoltLab%2FWCF.git Skip DOM updates when the article is not present --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Article/InlineEditor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Article/InlineEditor.js index 0c2a10d855..dcbfd07372 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Article/InlineEditor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Article/InlineEditor.js @@ -254,6 +254,10 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Language', 'U */ _triggerDelete: function(articleId) { var article = _articles.get(articleId); + if (!article) { + // The affected article might be hidden by the filter settings. + return; + } if (article.isArticleEdit) { window.location = this._options.redirectUrl; @@ -275,6 +279,10 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Language', 'U */ _triggerPublish: function(articleId) { var article = _articles.get(articleId); + if (!article) { + // The affected article might be hidden by the filter settings. + return; + } if (article.isArticleEdit) { // unsupported @@ -291,6 +299,10 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Language', 'U */ _triggerRestore: function(articleId) { var article = _articles.get(articleId); + if (!article) { + // The affected article might be hidden by the filter settings. + return; + } elHide(article.buttons.delete); elHide(article.buttons.restore); @@ -311,6 +323,10 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Language', 'U */ _triggerTrash: function(articleId) { var article = _articles.get(articleId); + if (!article) { + // The affected article might be hidden by the filter settings. + return; + } elShow(article.buttons.delete); elShow(article.buttons.restore); @@ -336,6 +352,10 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Language', 'U */ _triggerUnpublish: function(articleId) { var article = _articles.get(articleId); + if (!article) { + // The affected article might be hidden by the filter settings. + return; + } if (article.isArticleEdit) { // unsupported