Changeset d0de4eb in github


Ignore:
Timestamp:
Aug 4, 2011 6:52:17 AM (22 months ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
9f07d1d
Parents:
c6c99c8
Message:
  • Fix moving folder to root, it wasn't working with IMAP delimiter different that a dot
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/js/app.js

    rd961511 rd0de4eb  
    45494549      .mouseover(function(){ p.focus_subscription(this.id); }) 
    45504550      .mouseout(function(){ p.unfocus_subscription(this.id); }) 
    4551       .mouseup(function(){ if (p.drag_active) p.subscription_move_folder(); }); 
    45524551  }; 
    45534552 
     
    45604559    if (this.drag_active && this.env.mailbox && (row = document.getElementById(id))) 
    45614560      if (this.env.subscriptionrows[id] && 
    4562           (folder = this.env.subscriptionrows[id][0])) { 
     4561          (folder = this.env.subscriptionrows[id][0]) !== null 
     4562      ) { 
    45634563        if (this.check_droptarget(folder) && 
    45644564            !this.env.subscriptionrows[this.get_folder_row_id(this.env.mailbox)][2] && 
    45654565            (folder != this.env.mailbox.replace(reg, '')) && 
    4566             (!folder.match(new RegExp('^'+RegExp.escape(this.env.mailbox+this.env.delimiter))))) { 
     4566            (!folder.match(new RegExp('^'+RegExp.escape(this.env.mailbox+this.env.delimiter)))) 
     4567        ) { 
    45674568          this.set_env('dstfolder', folder); 
    45684569          $(row).addClass('droptarget'); 
    45694570        } 
    4570       } 
    4571       else if (id == 'mailboxroot') { 
    4572         this.set_env('dstfolder', ''); 
    4573         $(row).addClass('droptarget'); 
    4574       } 
    4575       else if (this.env.mailbox.match(new RegExp(delim))) { 
    4576         this.set_env('dstfolder', this.env.delimiter); 
    4577         $(this.subscription_list.frame).addClass('droptarget'); 
    45784571      } 
    45794572  }; 
     
    46134606      reg = RegExp('['+delim+']?[^'+delim+']+$'); 
    46144607 
    4615     if (this.env.mailbox && this.env.dstfolder && (this.env.dstfolder != this.env.mailbox) && 
     4608    if (this.env.mailbox && this.env.dstfolder !== null && (this.env.dstfolder != this.env.mailbox) && 
    46164609        (this.env.dstfolder != this.env.mailbox.replace(reg, '')) 
    46174610    ) { 
    46184611      reg = new RegExp('[^'+delim+']*['+delim+']', 'g'); 
    46194612      var basename = this.env.mailbox.replace(reg, ''), 
    4620         newname = this.env.dstfolder==this.env.delimiter ? basename : this.env.dstfolder+this.env.delimiter+basename; 
     4613        newname = this.env.dstfolder === '' ? basename : this.env.dstfolder+this.env.delimiter+basename; 
    46214614 
    46224615      if (newname != this.env.mailbox) { 
Note: See TracChangeset for help on using the changeset viewer.