From a698c06439a289d910d1df7a0b467e74306f27c1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 23 Nov 2011 23:22:30 +0100 Subject: [PATCH] Some more broken changes. 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 | 19 +++++++++++-------- wcfsetup/install/files/js/WCF.js | 21 ++++++++++----------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index d3720ce1f2..d1fbca6a62 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -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({ diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index c2a5c6a718..52a95062af 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -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); }, /** -- 2.20.1