Need a more unique DOM ID
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Apr 2010 18:27:14 +0000 (12:27 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Apr 2010 20:36:15 +0000 (14:36 -0600)
imp/js/ViewPort.js

index cc49a9e..1800755 100644 (file)
@@ -1546,7 +1546,7 @@ ViewPort_Buffer = Class.create({
             if (!Object.isUndefined(e)) {
                 // We can directly write the rownum to the original object
                 // since we will always rewrite when creating rows.
-                e.VP_domid = 'VP_row' + u;
+                e.VP_domid = 'VProw' + this.view + '_' + u;
                 e.VP_rownum = this.uidlist.get(u);
                 e.VP_id = u;
                 return e;
@@ -1709,10 +1709,11 @@ ViewPort_Selection = Class.create({
 
         case 'div':
             // ID here is the DOM ID of the element object.
-            return d.pluck('id').invoke('substring', 6);
+            d = d.pluck('id');
+            // Fall-through
 
         case 'domid':
-            return d.invoke('substring', 6);
+            return d.invoke('substring', 6 + this.buffer.getView().length);
 
         case 'rownum':
             return this.buffer.rowsToUIDs(d);