* @var string
*/
_actionName: '',
-
+
+ _api: null,
+
/**
* package installation dialog
*
* 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',
// update template
if ($data.template && !$data.ignoreTemplate) {
this._dialog.html($data.template);
+ this._api.redraw();
}
// handle inner template
$('#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) {
if ($('#packageInstallationInnerContent').children().length > 1) {
$('#packageInstallationInnerContentContainer').wcfBlindOut('vertical', $.proxy(function() {
$('#packageInstallationInnerContent').empty();
- this._dialog.wcfDialog('redraw');
+ this._api.redraw();
// execute callback
callback();
if (!additionalData) additionalData = {};
var $data = $.extend({
- node: node,
- queueID: this._queueID,
- step: step
+ node: node,
+ queueID: this._queueID,
+ step: step
}, additionalData);
$.ajax({
* @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
$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);
*
* @param string dialogID
* @param boolean resetDialog
+ * @return $.ui.wcfAJAXDialog
*/
showAJAXDialog: function(dialogID, resetDialog) {
if (!this._didInitDialogs) {
dialog.addClass('overlayLoading');
var dialogOptions = arguments[2] || {};
- dialog.wcfAJAXDialog(dialogOptions);
+ return dialog.wcfAJAXDialog(dialogOptions);
},
/**