Skip to content

Commit

Permalink
This is not a mbox - this is a message row
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jun 9, 2014
1 parent bf1e59c commit 2702f15
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions imp/js/dimpbase.js
Expand Up @@ -2333,18 +2333,19 @@ var DimpBase = {
mboxDropHandler: function(e)
{
var dropbase, sel, uids,
drag = this.flist.getMbox(e.memo.element),
drag = e.memo.element,
drag_m = this.flist.getMbox(drag_m),
drop = this.flist.getMbox(e.element());

if (drag.isMbox()) {
if (drag_m && drag_m.isMbox()) {
dropbase = (drop == $('dropbase'));
if (dropbase ||
(drop.ftype() != 'special' &&
!this.flist.isSubfolder(drag, drop))) {
!this.flist.isSubfolder(drag_m, drop))) {
DimpCore.doAction('renameMailbox', {
new_name: drag.label().unescapeHTML(),
new_name: drag_m.label().unescapeHTML(),
new_parent: dropbase ? '' : drop.value(),
old_name: drag.value()
old_name: drag_m.value()
});
}
} else if (drop.ftype() != 'container') {
Expand All @@ -2353,7 +2354,7 @@ var DimpBase = {
if (sel.size()) {
// Dragging multiple selected messages.
uids = sel;
} else if (drag.value() != drop.value()) {
} else if (drag.retrieve('mbox') != drop.value()) {
// Dragging a single unselected message.
uids = this.viewport.createSelection('domid', drag.id);
}
Expand Down Expand Up @@ -2408,7 +2409,7 @@ var DimpBase = {
break;
}

return drag.isMbox()
return (drag && drag.isMbox())
? ((drop.ftype() != 'special' && !this.flist.isSubfolder(drag, drop.element())) ? m.sub('%s', drag.label()).sub('%s', drop.label()) : '')
: ((drop.ftype() != 'container') ? m.sub('%s', this.messageCountText(this.selectedCount())).sub('%s', drop.label()) : '');
},
Expand Down

0 comments on commit 2702f15

Please sign in to comment.