Ticket #330: closebox.patch
| File closebox.patch, 4.1 kB (added by euzuro, 2 years ago) |
|---|
-
lib/OpenLayers/Popup/AnchoredBubble.js
old new 28 28 * - 'size' (OpenLayers.Size) and 29 29 * - 'offset' (OpenLayers.Pixel) 30 30 * (this is generally an OpenLayers.Icon) 31 * @param {Boolean} closeBox 31 32 */ 32 initialize:function(id, lonlat, size, contentHTML, anchor ) {33 initialize:function(id, lonlat, size, contentHTML, anchor, closeBox) { 33 34 OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments); 34 35 }, 35 36 -
lib/OpenLayers/Popup/Anchored.js
old new 31 31 * - 'size' (OpenLayers.Size) and 32 32 * - 'offset' (OpenLayers.Pixel) 33 33 * (this is generally an OpenLayers.Icon) 34 * @param {Boolean} closeBox 34 35 */ 35 initialize:function(id, lonlat, size, contentHTML, anchor ) {36 var newArguments = new Array(id, lonlat, size, contentHTML );36 initialize:function(id, lonlat, size, contentHTML, anchor, closeBox) { 37 var newArguments = new Array(id, lonlat, size, contentHTML, closeBox); 37 38 OpenLayers.Popup.prototype.initialize.apply(this, newArguments); 38 39 39 40 this.anchor = (anchor != null) ? anchor -
lib/OpenLayers/Popup.js
old new 60 60 * @param {OpenLayers.LonLat} lonlat 61 61 * @param {OpenLayers.Size} size 62 62 * @param {String} contentHTML 63 * @param {Boolean} closeBox 63 64 */ 64 initialize:function(id, lonlat, size, contentHTML ) {65 initialize:function(id, lonlat, size, contentHTML, closeBox) { 65 66 if (id == null) { 66 67 id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 67 68 } … … 90 91 this.contentDiv.className = 'olPopupContent'; 91 92 this.div.appendChild(this.contentDiv); 92 93 94 if (closeBox == true) { 95 // close icon 96 var closeSize = new OpenLayers.Size(17,17); 97 var img = OpenLayers.Util.getImagesLocation() + "close.gif"; 98 var closeImg = OpenLayers.Util.createAlphaImageDiv(this.id + "_close", 99 null, 100 closeSize, 101 img); 102 closeImg.style.right = this.padding + "px"; 103 closeImg.style.top = this.padding + "px"; 104 this.div.appendChild(closeImg); 105 106 var closeEvents = new OpenLayers.Events(this, closeImg); 107 closeEvents.register("mousedown", this, this.hide); 108 109 } 110 93 111 this.registerEvents(); 94 112 }, 95 113 -
examples/popups.html
old new 37 37 popup = new OpenLayers.Popup("chicken", 38 38 new OpenLayers.LonLat(5,40), 39 39 new OpenLayers.Size(200,200), 40 "example popup"); 40 "example popup", 41 true); 41 42 42 43 map.addPopup(popup); 43 44 }
