Changed insert method for profile tab content
authorAlexander Ebert <ebert@woltlab.com>
Sun, 31 Jan 2016 17:31:01 +0000 (18:31 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 31 Jan 2016 17:31:01 +0000 (18:31 +0100)
wcfsetup/install/files/js/WCF.User.js

index 0deed44b624fa7a5f87301cb088000ef4a2f8720..5dbf497195e769d0d583060b621d7dc9edf0cce6 100644 (file)
@@ -1010,12 +1010,11 @@ WCF.User.Profile.TabMenu = Class.extend({
                var $containerID = data.returnValues.containerID;
                this._hasContent[$containerID] = true;
                
-               // insert content
-               var $content = this._profileContent.find('#' + $containerID);
-               $('<div>' + data.returnValues.template + '</div>').hide().appendTo($content);
-               
-               // slide in content
-               $content.children('div').wcfBlindIn();
+               // insert content, uses non jQuery because DomUtil.insertHtml() moves <script> elements
+               // to the bottom of the element by default which is exactly what is required here
+               require(['Dom/Util'], function(DomUtil) {
+                       DomUtil.insertHtml(data.returnValues.template, elById($containerID), 'append');
+               });
        }
 });