From: Alexander Ebert Date: Fri, 25 Nov 2011 19:34:10 +0000 (+0100) Subject: Merge branch 'master' of github.com:WoltLab/WCF X-Git-Tag: 2.0.0_Beta_1~1544^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e9e5842ba68b7811b4b178a0785de0724fb2fac;p=GitHub%2FWoltLab%2FWCF.git Merge branch 'master' of github.com:WoltLab/WCF --- 0e9e5842ba68b7811b4b178a0785de0724fb2fac diff --cc wcfsetup/install/files/js/WCF.js index ebbc4e0456,64a6dee9f8..5dce694cd3 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@@ -3360,40 -3351,7 +3360,40 @@@ $.widget('ui.wcfDialog', this.options.success(data, textStatus, jqXHR); } }, - + + /** + * Initializes dialog content if applicable. + * + * @param object data + */ + _initDialog: function(data) { + // insert template + data.ignoreTemplate = true; + var $template = this._getResponseValue(data, 'template'); + if ($template !== null) { + this._content.children().html($template); + this.render(); + } + }, + + /** + * Returns a response value, taking care of different object + * structure returned by AJAXProxy. + * + * @param object data + * @param string key + */ + _getResponseValue: function(data, key) { + if (data.returnValues && data.returnValues[key]) { + return data.returnValues[key]; + } + else if (data[key]) { + return data[key]; + } + + return null; + }, + /** * Opens this dialog. */