Fix selection list when working with search mailboxes
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 16 Apr 2010 21:17:02 +0000 (15:17 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 16 Apr 2010 21:35:37 +0000 (15:35 -0600)
imp/js/DimpCore.js
imp/js/ViewPort.js

index 0de9b12..a1cf4de 100644 (file)
@@ -138,11 +138,13 @@ var DimpCore = {
             tmp = {};
 
         if (b.getMetaData('search')) {
-            s.get('dataob').each(function(r) {
-                if (!tmp[r.view]) {
-                    tmp[r.view] = [];
+            s.get('uid').each(function(r) {
+                var parts = r.split(DIMP.conf.IDX_SEP);
+                if (tmp[parts[1]]) {
+                    tmp[parts[1]].push(parts[0]);
+                } else {
+                    tmp[parts[1]] = [ parts[0] ];
                 }
-                tmp[r.view].push(r.imapuid);
             });
         } else {
             tmp[b.getView()] = s.get('uid');
index 33d66d0..4e79757 100644 (file)
@@ -1225,7 +1225,7 @@ var ViewPort = Class.create({
     getSelection: function(view)
     {
         var buffer = this._getBuffer(view);
-        return this.createSelection('uid', buffer ? buffer.getAllUIDs() : [], view);
+        return this.createSelection('uid', buffer ? buffer.getSelected().get('uid') : [], view);
     },
 
     // vs = (Viewport_Selection | array) A Viewport_Selection object -or- if