forked from extern/egroupware
only set this.iframe and this.splitter if et2_ready is called for admin.index template
This commit is contained in:
parent
d01d5119ca
commit
8e0dea8316
@ -55,13 +55,17 @@ app.classes.admin = AppJS.extend(
|
||||
* and ready. If you must store a reference to the et2 object,
|
||||
* make sure to clean it up in destroy().
|
||||
*
|
||||
* @param _et2 etemplate2 Newly ready object
|
||||
* @param {etemplate2} _et2
|
||||
* @param {string} _name name of template loaded
|
||||
*/
|
||||
et2_ready: function(_et2)
|
||||
et2_ready: function(_et2, _name)
|
||||
{
|
||||
// call parent
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
switch(_name)
|
||||
{
|
||||
case 'admin.index':
|
||||
var iframe = this.iframe = this.et2.getWidgetById('iframe');
|
||||
if (iframe)
|
||||
{
|
||||
@ -78,6 +82,11 @@ app.classes.admin = AppJS.extend(
|
||||
register_app_refresh('admin',jQuery.proxy(this.refresh,this));
|
||||
}
|
||||
this.splitter = this.et2.getWidgetById('splitter');
|
||||
break;
|
||||
|
||||
case 'admin.categories.index':
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -89,7 +98,7 @@ app.classes.admin = AppJS.extend(
|
||||
* @param {string} _msg Message to display
|
||||
* @param {string} _app Application being refreshed, should be 'admin'
|
||||
* @param {string} _id Unique record ID.
|
||||
* @param {string} _type=null Type of refresh. Either 'edit', 'delete',
|
||||
* @param {string} _type Type of refresh. Either 'edit', 'delete',
|
||||
* 'add' or null
|
||||
*/
|
||||
refresh: function(_msg, _app, _id, _type)
|
||||
@ -106,6 +115,8 @@ app.classes.admin = AppJS.extend(
|
||||
{
|
||||
var document = this.iframe.getDOMNode().contentDocument;
|
||||
|
||||
if (!document) return; // nothing we can do ...
|
||||
|
||||
// set white background, as transparent one lets account-list show through
|
||||
document.getElementsByTagName('body')[0].style.backgroundColor = 'white';
|
||||
|
||||
@ -140,9 +151,8 @@ app.classes.admin = AppJS.extend(
|
||||
*/
|
||||
linkHandler: function(_url)
|
||||
{
|
||||
var matches;
|
||||
if (_url !='about:blank'&& (this.iframe != null && !_url.match('menuaction=admin.admin_ui.index') ||
|
||||
(matches = _url.match(/menuaction=admin.admin_ui.index.*&load=([^&]+)/))))
|
||||
var matches = _url.match(/menuaction=admin.admin_ui.index.*&load=([^&]+)/);
|
||||
if (_url !='about:blank' && (this.iframe != null && !_url.match('menuaction=admin.admin_ui.index') || matches))
|
||||
{
|
||||
if (matches)
|
||||
{
|
||||
@ -158,8 +168,8 @@ app.classes.admin = AppJS.extend(
|
||||
/**
|
||||
* Run an admin module / onclick callback for tree
|
||||
*
|
||||
* @param string _id id of clicked node
|
||||
* @param et2_tree _widget reference to tree widget
|
||||
* @param {string} _id id of clicked node
|
||||
* @param {et2_tree} _widget reference to tree widget
|
||||
*/
|
||||
run: function(_id, _widget)
|
||||
{
|
||||
@ -189,8 +199,8 @@ app.classes.admin = AppJS.extend(
|
||||
/**
|
||||
* View, edit or delete a group callback for tree
|
||||
*
|
||||
* @param Object _action egwAction
|
||||
* @param Object _senders egwActionObject _senders[0].id holds id
|
||||
* @param {object} _action egwAction
|
||||
* @param {array} _senders egwActionObject _senders[0].id holds id
|
||||
*/
|
||||
group: function(_action, _senders)
|
||||
{
|
||||
@ -222,8 +232,8 @@ app.classes.admin = AppJS.extend(
|
||||
/**
|
||||
* Modify an ACL entry
|
||||
*
|
||||
* @param Object _action egwAction
|
||||
* @param Object _senders egwActionObject _senders[0].id holds the id "admin::app:account:location"
|
||||
* @param {object} _action egwAction
|
||||
* @param {array} _senders egwActionObject _senders[0].id holds the id "admin::app:account:location"
|
||||
*/
|
||||
acl: function(_action, _senders)
|
||||
{
|
||||
@ -244,7 +254,7 @@ app.classes.admin = AppJS.extend(
|
||||
// need to specify window to get correct opener, as admin has multiple windows open!
|
||||
egw('admin', window).open_link(egw.link('/index.php', {
|
||||
menuaction: 'admin.admin_acl.acl',
|
||||
id: ids[0],
|
||||
id: ids[0]
|
||||
}), 'acl', '300x300');
|
||||
break;
|
||||
|
||||
@ -262,7 +272,7 @@ app.classes.admin = AppJS.extend(
|
||||
/**
|
||||
* Callback called on successfull call of serverside ACL handling
|
||||
*
|
||||
* @param string _data returned from server
|
||||
* @param {object} _data returned from server
|
||||
*/
|
||||
_acl_callback: function(_data)
|
||||
{
|
||||
@ -350,6 +360,5 @@ app.classes.admin = AppJS.extend(
|
||||
{
|
||||
img.set_src(widget.getValue());
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user