Fix resuming drafts in dimp
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Dec 2010 08:00:46 +0000 (01:00 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Dec 2010 09:06:28 +0000 (02:06 -0700)
imp/js/dimpbase.js

index 0c6b6ca..c2aeac9 100644 (file)
@@ -2024,18 +2024,20 @@ var DimpBase = {
         }
 
         var elt = e.element(),
-            tmp;
+            tmp, tmp2;
 
         if (!elt.hasClassName('vpRow')) {
             elt = elt.up('.vpRow');
         }
 
         if (elt) {
-            tmp = this.viewport.createSelection('domid', elt.identify()).get('dataob');
-            if (tmp.first().draft && this.viewport.getMetaData('drafts')) {
+            tmp = this.viewport.createSelection('domid', elt.identify());
+            tmp2 = tmp.get('dataob').first();
+
+            if (tmp2.draft && this.viewport.getMetaData('drafts')) {
                 DimpCore.compose('resume', { uids: tmp });
             } else {
-                this.msgWindow(tmp.first());
+                this.msgWindow(tmp2);
             }
             e.stop();
         }