Show the erroneous tab on submit
authorAlexander Ebert <ebert@woltlab.com>
Wed, 9 Mar 2022 16:50:23 +0000 (17:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 9 Mar 2022 16:50:23 +0000 (17:50 +0100)
Fixes https://www.woltlab.com/community/thread/294204-meldung-bei-nicht-erfolgreichem-box-speichern-wegen-quellcode-modus/

ts/WoltLabSuite/Core/Ui/TabMenu.ts
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSource.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu.js

index 21fdeddb77375994a311f04b25959fc83ab1fde6..e3988290218b8f0c2f691c926a0b60e811528ef0 100644 (file)
@@ -119,7 +119,7 @@ function init() {
 /**
  * Selects the first tab containing an element with class `formError`.
  */
-function selectErroneousTabs(): void {
+export function selectErroneousTabs(): void {
   _tabMenus.forEach((tabMenu) => {
     let foundError = false;
     tabMenu.getContainers().forEach((container) => {
index eab7d7ba3dc1383206f09fa005c3d7c79f54f7da..d136722e04084cde94c7c057ef7e93cde906c291 100644 (file)
@@ -133,8 +133,8 @@ $.Redactor.prototype.WoltLabSource = function() {
                                                        submitButton.disabled = false;
                                                }
 
-                                               require(['WoltLabSuite/Core/Ui/TabMenu'], function(UiTabMenu) {
-                                                       UiTabMenu._selectErroneousTabs();
+                                               require(['WoltLabSuite/Core/Ui/TabMenu'], ({ selectErroneousTabs }) => {
+                                                       selectErroneousTabs();
                                                });
                                        }
 
index 5e2f3f021c01f7c3cc89049d711bbe7130940122..092e81adbe89c8b3d89c1a2836a22f91753c999f 100644 (file)
@@ -10,7 +10,7 @@
 define(["require", "exports", "tslib", "../Dom/Change/Listener", "../Dom/Util", "./TabMenu/Simple", "./CloseOverlay", "./Screen", "./Scroll"], function (require, exports, tslib_1, Listener_1, Util_1, Simple_1, CloseOverlay_1, UiScreen, UiScroll) {
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
-    exports.scrollToTab = exports.getTabMenu = exports.setup = void 0;
+    exports.scrollToTab = exports.getTabMenu = exports.setup = exports.selectErroneousTabs = void 0;
     Listener_1 = tslib_1.__importDefault(Listener_1);
     Util_1 = tslib_1.__importDefault(Util_1);
     Simple_1 = tslib_1.__importDefault(Simple_1);
@@ -116,6 +116,7 @@ define(["require", "exports", "tslib", "../Dom/Change/Listener", "../Dom/Util",
             });
         });
     }
+    exports.selectErroneousTabs = selectErroneousTabs;
     function scrollEnable(isSetup) {
         _enableTabScroll = true;
         _tabMenus.forEach((tabMenu) => {