Changeset 2607 in subversion


Ignore:
Timestamp:
Jun 4, 2009 4:01:31 PM (4 years ago)
Author:
alec
Message:
  • fix drag_move performance
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r2592 r2607  
    12631263      for (var k in model) { 
    12641264        if (li = this.get_folder_li(k)) { 
    1265           pos = $(li.firstChild).offset(); 
    1266           // only visible folders 
    1267           if (height = li.firstChild.offsetHeight) 
    1268             this.env.folder_coords[k] = { x1:pos.left, y1:pos.top, x2:pos.left + li.firstChild.offsetWidth, y2:pos.top + height }; 
     1265          // only visible folders 
     1266          if (height = li.firstChild.offsetHeight) { 
     1267            pos = $(li.firstChild).offset(); 
     1268            this.env.folder_coords[k] = { x1:pos.left, y1:pos.top, x2:pos.left + li.firstChild.offsetWidth, y2:pos.top + height, on:0 }; 
     1269          } 
    12691270        } 
    12701271      } 
     
    13091310        return; 
    13101311      } 
    1311  
     1312     
     1313      var last = this.env.last_folder_target; 
    13121314      // over the folders 
    13131315      for (var k in this.env.folder_coords) { 
    13141316        pos = this.env.folder_coords[k]; 
    1315         if (this.check_droptarget(k) && ((mouse.x >= pos.x1) && (mouse.x < pos.x2)  
    1316             && (mouse.y >= pos.y1) && (mouse.y < pos.y2))) { 
     1317        if ((mouse.x >= pos.x1) && (mouse.x < pos.x2)  
     1318            && (mouse.y >= pos.y1) && (mouse.y < pos.y2) 
     1319            && this.check_droptarget(k)) { 
     1320          if (k == last) 
     1321            continue;  
    13171322          $(this.get_folder_li(k)).addClass('droptarget'); 
    13181323          this.env.last_folder_target = k; 
    1319         } 
    1320         else { 
     1324          this.env.folder_coords[k].on = 1; 
     1325        } 
     1326        else if (pos.on){ 
     1327          if (k == last) 
     1328            this.env.last_folder_target = null; 
     1329          this.env.folder_coords[k].on = 0; 
    13211330          $(this.get_folder_li(k)).removeClass('droptarget'); 
    1322           if (k == this.env.last_folder_target) 
    1323             this.env.last_folder_target = null; 
    1324         } 
     1331        } 
    13251332      } 
    13261333    } 
    13271334  }; 
    1328    
     1335 
    13291336  this.collapse_folder = function(id) 
    13301337    { 
Note: See TracChangeset for help on using the changeset viewer.