From: Alexander Ebert Date: Sat, 20 Jun 2015 10:03:06 +0000 (+0200) Subject: Fixed two `Ajax` related issues in `UI/Dialog` X-Git-Tag: 3.0.0_Beta_1~2263 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5c489d2717ca4cc5628b59a44b7b5039a8cce904;p=GitHub%2FWoltLab%2FWCF.git Fixed two `Ajax` related issues in `UI/Dialog` --- 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 {}; } };