From 5c489d2717ca4cc5628b59a44b7b5039a8cce904 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 20 Jun 2015 12:03:06 +0200 Subject: [PATCH] Fixed two `Ajax` related issues in `UI/Dialog` --- wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js b/wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js index c43a83d4c3..aafaf56fb9 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js @@ -35,6 +35,9 @@ define( * Sets up global container and internal variables. */ setup: function() { + // Fetch Ajax, as it cannot be provided because of a circular dependency + if (Ajax === undefined) Ajax = require('Ajax'); + _container = document.createElement('div'); _container.classList.add('dialogOverlay'); _container.setAttribute('aria-hidden', 'true'); @@ -107,9 +110,7 @@ define( setupData.source(); } else if (Core.isPlainObject(setupData.source)) { - Ajax.api(this, { - data: setupData.source.data - }, (function(data) { + Ajax.api(this, setupData.source.data, (function(data) { if (data.returnValues && typeof data.returnValues.template === 'string') { this.open(callbackObject, data.returnValues.template); @@ -492,6 +493,10 @@ define( */ getDialog: function(id) { return _dialogs.get(id); + }, + + _ajaxSetup: function() { + return {}; } }; -- 2.20.1