Skip to content

Commit

Permalink
No need for separate ftype variable; this can be dynamically determin…
Browse files Browse the repository at this point in the history
…ed via internal data
  • Loading branch information
slusarz committed Jun 5, 2014
1 parent 5a0de49 commit 022aac9
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions imp/js/dimpbase.js
Expand Up @@ -4133,7 +4133,7 @@ var IMP_Flist_Mbox = Class.create({
var div, f_node, ll, mbox, parent_c, parent_e, title, tmp,
cname = 'imp-sidebar-container';

// Extra fields: dummy, elt, fixed, ftype, unseen
// Extra fields: dummy, elt, fixed, unseen
this.data = ob;

title = ob.t || ob.l;
Expand All @@ -4148,38 +4148,19 @@ var IMP_Flist_Mbox = Class.create({
}

if (ob.v) {
if (ob.co) {
this.data.ftype = 'vcontainer';
} else {
if (!ob.co) {
cname = 'imp-sidebar-mbox';
this.data.ftype = 'vfolder';
}
title = this.label();
} else if (ob.r) {
switch (ob.r) {
case 1:
this.data.ftype = 'rcontainer';
break;

case 2:
if (ob.r == 2) {
cname = 'imp-sidebar-remote';
this.data.ftype = 'remote';
break;

case 3:
this.data.ftype = 'remoteauth';
break;
}
} else if (ob.co) {
if (ob.n) {
this.data.ftype = 'scontainer';
title = this.label();
} else {
this.data.ftype = 'container';
}
} else {
cname = 'imp-sidebar-mbox';
this.data.ftype = ob.s ? 'special' : 'mbox';
}

div = new Element('DIV', { className: 'horde-subnavi-icon' });
Expand Down Expand Up @@ -4321,7 +4302,26 @@ var IMP_Flist_Mbox = Class.create({

ftype: function()
{
return this.data.ftype;
if (this.data.v) {
return this.data.co ? 'vcontainer' : 'vfolder';
} else if (this.data.r) {
switch (this.data.r) {
case 1:
return 'rcontainer';

case 2:
return 'remote';

case 3:
return 'remoteauth';
}
} else if (this.data.co) {
return this.data.n ? 'scontainer' : 'container';
} else if (this.data.s) {
return 'special';
}

return 'mbox';
},

nc: function()
Expand Down

0 comments on commit 022aac9

Please sign in to comment.