Changeset 7829
- Timestamp:
- 08/22/08 09:23:16 (5 months ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Control.js (modified) (1 diff)
- trunk/openlayers/tests/Control.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control.js
r7675 r7829 177 177 this.events.on(this.eventListeners); 178 178 } 179 this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 179 if (this.id == null) { 180 this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 181 } 180 182 }, 181 183 trunk/openlayers/tests/Control.html
r6719 r7829 4 4 <script type="text/javascript"> 5 5 function test_Control_constructor(t) { 6 t.plan( 2);6 t.plan(4); 7 7 8 8 var control = new OpenLayers.Control(); … … 10 10 t.ok(control instanceof OpenLayers.Control, "new OpenLayers.Control returns object"); 11 11 t.eq(control.displayClass, "olControl", "displayClass set correctly"); 12 t.ok(control.id != null, "default id assigned to control"); 13 14 var testID = {}; 15 control = new OpenLayers.Control({ 'id': testID }); 16 t.ok(control.id == testID, "if id specified in options, no default assigned."); 12 17 } 13 18
