Added preselection of tab containg an error
authorAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jun 2016 11:01:35 +0000 (13:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 5 Jun 2016 11:01:35 +0000 (13:01 +0200)
wcfsetup/install/files/js/WCF.Message.js

index aea6dce9f16c708899ee9a2d1a82c0a64c0fac63..933b2a161c96dcafd7dc5e4d8292a67a781fc95d 100644 (file)
@@ -2569,6 +2569,15 @@ $.widget('wcf.messageTabMenu', {
                this._span = $('<span />').appendTo($nav);
                
                var $preselect = this.element.data('preselect');
+               
+               // check for tabs containing '.innerError' and select the first matching one instead
+               $tabContainers.each(function(index, container) {
+                       if (elBySel('.innerError', container) !== null) {
+                               $preselect = $($tabs[index]).data('name');
+                               return false;
+                       }
+               });
+               
                this._tabs = [ ];
                this._tabsByName = { };
                for (var $i = 0; $i < $tabs.length; $i++) {