Some more broken changes.
authorAlexander Ebert <ebert@woltlab.com>
Wed, 23 Nov 2011 22:22:30 +0000 (23:22 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 23 Nov 2011 22:22:30 +0000 (23:22 +0100)
Yes, I regret choosing jQuery UI Dialog, it is so much unflexible and incomplete. AJAX features? Fat chance, it's completely unusable. Customization? Hell no, something always breaks. ALWAYS.

wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/js/WCF.js

index d3720ce1f276b2b5e00d7722dcc90c6e65b580f4..d1fbca6a62e865ff366b51d9ef7a5ce4f823a669 100644 (file)
@@ -199,7 +199,9 @@ WCF.ACP.PackageInstallation.prototype = {
         * @var string
         */
        _actionName: '',
-       
+
+       _api: null,
+
        /**
         * package installation dialog
         *
@@ -237,7 +239,7 @@ WCF.ACP.PackageInstallation.prototype = {
         * Prepares installation dialog.
         */
        prepareInstallation: function() {
-               WCF.showAJAXDialog('packageInstallationDialog', true, {
+               this._api = WCF.showAJAXDialog('packageInstallationDialog', true, {
                        ajax: {
                                url: 'index.php/' + this._actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND,
                                type: 'POST',
@@ -294,6 +296,7 @@ WCF.ACP.PackageInstallation.prototype = {
                // update template
                if ($data.template && !$data.ignoreTemplate) {
                        this._dialog.html($data.template);
+                       this._api.redraw();
                }
                
                // handle inner template
@@ -325,14 +328,14 @@ WCF.ACP.PackageInstallation.prototype = {
                        
                        $('#packageInstallationInnerContentContainer').wcfBlindIn();
                        
-                       this._dialog.wcfDialog('redraw');
+                       this._api.redraw();
                        return;
                }
                
                // purge content
                this._purgeTemplateContent($.proxy(function() {
                        // redraw container
-                       this._dialog.wcfDialog('redraw');
+                       this._api.redraw();
                        
                        // execute next step
                        if ($data.step && $data.node) {
@@ -350,7 +353,7 @@ WCF.ACP.PackageInstallation.prototype = {
                if ($('#packageInstallationInnerContent').children().length > 1) {
                        $('#packageInstallationInnerContentContainer').wcfBlindOut('vertical', $.proxy(function() {
                                $('#packageInstallationInnerContent').empty();
-                               this._dialog.wcfDialog('redraw');
+                               this._api.redraw();
                                
                                // execute callback
                                callback();
@@ -372,9 +375,9 @@ WCF.ACP.PackageInstallation.prototype = {
                if (!additionalData) additionalData = {};
                
                var $data = $.extend({
-                               node: node,
-                               queueID: this._queueID,
-                               step: step
+                       node: node,
+                       queueID: this._queueID,
+                       step: step
                }, additionalData);
                
                $.ajax({
index c2a5c6a718c483621f3b0a9cee577d20dcbe09d4..52a95062af28a0f36b35378296b2f4d24b92d4fc 100644 (file)
@@ -269,11 +269,14 @@ $.fn.extend({
         * @return      jQuery
         */
        wcfGrow: function(data, options) {
+               var $content = $(data.content);
+               var $parent = (data.parent) ? $(data.parent) : $(this);
+               
                // calculate dimensions
                var $windowDimensions = $(window).getDimensions();
-               var $elementDimensions = data.content.getDimensions('outer');
-               var $parentDimensions = data.parent.getDimensions('outer');
-               var $parentInnerDimensions = data.parent.getDimensions('inner');
+               var $elementDimensions = $content.getDimensions('outer');
+               var $parentDimensions = $parent.getDimensions('outer');
+               var $parentInnerDimensions = $parent.getDimensions('inner');
                var $parentDifference = {
                        height: $parentDimensions.height - $parentInnerDimensions.height,
                        width: $parentDimensions.width - $parentInnerDimensions.width
@@ -289,13 +292,8 @@ $.fn.extend({
                        $topOffset = $desiredTopOffset;
                }
                
-               // move parent element, used if applying effect on dialogs
-               if (!data.parent) {
-                       data.parent = this;
-               }
-               
-               data.parent.makePositioned('fixed', false);
-               data.parent.animate({
+               $parent.makePositioned('fixed', false);
+               $parent.animate({
                        left: $leftOffset + 'px',
                        top: $topOffset + 'px'
                }, options);
@@ -396,6 +394,7 @@ $.extend(WCF, {
         * 
         * @param       string          dialogID
         * @param       boolean         resetDialog
+        * @return      $.ui.wcfAJAXDialog
         */
        showAJAXDialog: function(dialogID, resetDialog) {
                if (!this._didInitDialogs) {
@@ -422,7 +421,7 @@ $.extend(WCF, {
                dialog.addClass('overlayLoading');
                
                var dialogOptions = arguments[2] || {};
-               dialog.wcfAJAXDialog(dialogOptions);
+               return dialog.wcfAJAXDialog(dialogOptions);
        },
        
        /**