Changeset 2645
- Timestamp:
- 03/09/07 16:54:41 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (2 diffs)
- trunk/openlayers/tests/test_Util.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Util.js
r2541 r2645 623 623 } 624 624 625 OpenLayers.Util.lastSeqID = 0; 626 625 627 /** 626 628 * @param {String} prefix String to prefix random id. If null, default … … 634 636 prefix = "id_"; 635 637 } 636 return prefix + Math.round(Math.random() * 10000); 638 OpenLayers.Util.lastSeqID += 1; 639 return prefix + OpenLayers.Util.lastSeqID; 637 640 }; 638 641 trunk/openlayers/tests/test_Util.html
r2232 r2645 564 564 565 565 } 566 566 function test_Util_createUniqueIDSeq(t) { 567 t.plan(1); 568 OpenLayers.Util.lastSeqID = 0; 569 OpenLayers.Util.createDiv(); 570 OpenLayers.Util.createDiv(); 571 t.eq(OpenLayers.Util.createDiv().id, "OpenLayersDiv3", "Div created is sequential, starting at lastSeqID in Util."); 572 } 567 573 // --> 568 574 </script>
