Skip to content

Commit

Permalink
More support for fake elements
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jun 9, 2014
1 parent ab7fb35 commit 46865d0
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions imp/js/dimpbase.js
Expand Up @@ -4038,15 +4038,30 @@ var IMP_Flist = Class.create({

getMbox: function(id)
{
if (Object.isElement(id)) {
id = id.retrieve('mbox');
var ob;

if (Object.isUndefined(id)) {
return null;
} else if (Object.isString(id)) {
return this.mboxes[id];
} else if (Object.isElement(id)) {
ob = this.mboxes[id.retrieve('mbox')];
if (ob) {
if (ob.element() == id) {
return ob;
}
ob = ob.fake();
if (ob && ob.element() == id) {
return ob;
}
}
} else if (Object.isFunction(id.value)) {
return id;
} else if (Object.isFunction(id.findElement)) {
return this.getMbox(id.findElement('DIV.horde-subnavi'));
}

return this.mboxes[id];
return null;
},

// m: (string) Mailbox ID
Expand Down Expand Up @@ -4344,6 +4359,11 @@ var IMP_Flist_Mbox = Class.create({
return this.data.m;
},

fake: function()
{
return this.data.fake;
},

isContainer: function()
{
return this.data.elt.hasClassName('imp-sidebar-container');
Expand Down

0 comments on commit 46865d0

Please sign in to comment.