Ticket #1015: createDiv.00.patch
| File createDiv.00.patch, 2.5 kB (added by fredj, 1 year ago) |
|---|
-
tests/test_Layer.html
old new 5 5 var layer; 6 6 7 7 function test_01_Layer_constructor (t) { 8 t.plan( 1 3);8 t.plan( 15 ); 9 9 10 10 var options = { chicken: 151, foo: "bar", projection: "none" }; 11 11 var layer = new OpenLayers.Layer('Test Layer', options); … … 19 19 t.ok( ((layer.chicken == 151) && (layer.foo == "bar")), "layer.options correctly set to Layer Object" ); 20 20 t.ok( ((layer.options["chicken"] == 151) && (layer.options["foo"] == "bar")), "layer.options correctly backed up" ); 21 21 22 t.ok( typeof layer.div == "object" , "layer.div is created" ); 23 t.eq( layer.div.id, layer.id, "layer.div.id is correct" ); 24 22 25 options.chicken = 552; 23 26 24 27 t.eq( layer.options["chicken"], 151 , "layer.options correctly made fresh copy" ); -
lib/OpenLayers/Layer.js
old new 32 32 * Constant: EVENT_TYPES 33 33 * {Array(String)} Supported application event types 34 34 */ 35 EVENT_TYPES: [ "loadstart", "loadend", "loadcancel", "visibilitychanged"],35 EVENT_TYPES: ["loadstart", "loadend", "loadcancel", "visibilitychanged"], 36 36 37 37 /** 38 * APIProperty: events ``38 * APIProperty: events 39 39 * {<OpenLayers.Events>} 40 40 */ 41 41 events: null, … … 238 238 239 239 this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 240 240 241 this.div = OpenLayers.Util.createDiv( );241 this.div = OpenLayers.Util.createDiv(this.id); 242 242 this.div.style.width = "100%"; 243 243 this.div.style.height = "100%"; 244 this.div.id = this.id;245 244 246 245 this.events = new OpenLayers.Events(this, this.div, 247 246 this.EVENT_TYPES); -
lib/OpenLayers/Control.js
old new 166 166 */ 167 167 draw: function (px) { 168 168 if (this.div == null) { 169 this.div = OpenLayers.Util.createDiv(); 170 this.div.id = this.id; 169 this.div = OpenLayers.Util.createDiv(this.id); 171 170 this.div.className = this.displayClass; 172 171 } 173 172 if (px != null) {
