Changeset 6676
- Timestamp:
- 03/28/08 21:25:49 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/euzuro/pop/lib/OpenLayers/Popup/Anchored.js
r6650 r6676 93 93 */ 94 94 moveTo: function(px) { 95 var oldRelativePosition = this.relativePosition; 95 96 this.relativePosition = this.calculateRelativePosition(px); 96 97 … … 99 100 var newArguments = new Array(newPx); 100 101 OpenLayers.Popup.prototype.moveTo.apply(this, newArguments); 102 103 if (this.relativePosition != oldRelativePosition) { 104 this.updateRelativePosition(); 105 } 106 }, 107 108 /** 109 * Method: updateRelativePosition 110 * The popup has been moved to a new relative location, so we may want to 111 * make some cosmetic adjustments to it. 112 * 113 * Note that in the classic Anchored popup, there is nothing to do 114 * here, since the popup looks exactly the same in all four positions. 115 * Subclasses such as the AnchoredBubble and Framed, however, will 116 * want to do something special here. 117 */ 118 updateRelativePosition: function() { 119 //to be overridden by subclasses 101 120 }, 102 121 sandbox/euzuro/pop/lib/OpenLayers/Popup/AnchoredBubble.js
r6600 r6676 70 70 71 71 /** 72 * Method: moveTo73 * The popup may havebeen moved to a new relative location, in which case72 * Method: updateRelativePosition 73 * The popup has been moved to a new relative location, in which case 74 74 * we will want to re-do the rico corners. 75 *76 * Parameters:77 * px - {<OpenLayers.Pixel>}78 75 */ 79 moveTo: function(px) { 80 OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, arguments); 81 this.setRicoCorners(!this.rounded); 82 this.rounded = true; 76 updateRelativePosition: function() { 77 this.setRicoCorners(); 83 78 }, 84 79 … … 90 85 */ 91 86 setSize:function(size) { 92 93 87 OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); 94 88 95 //finally, we re-round the corners 96 if (this.map) { 97 this.setRicoCorners(!this.rounded); 98 this.rounded = true; 99 } 100 89 this.setRicoCorners(); 101 90 }, 102 91 … … 152 141 * Method: setRicoCorners 153 142 * Update RICO corners according to the popup's current relative postion. 154 *155 * Parameters:156 * firstTime - {Boolean} This the first time the corners are being rounded.157 143 */ 158 setRicoCorners:function( firstTime) {144 setRicoCorners:function() { 159 145 160 146 var corners = this.getCornersToRound(this.relativePosition); … … 164 150 blend: false}; 165 151 166 if ( firstTime) {152 if (!this.rounded) { 167 153 OpenLayers.Rico.Corner.round(this.div, options); 154 this.rounded = true; 168 155 } else { 169 156 OpenLayers.Rico.Corner.reRound(this.groupDiv, options); sandbox/euzuro/pop/lib/OpenLayers/Popup/Framed.js
r6671 r6676 149 149 150 150 /** 151 * APIMethod: moveTo 152 * 153 * Parameters: 154 * px - {<OpenLayers.Pixel>} 155 */ 156 moveTo: function(px) { 157 OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, arguments); 158 159 this.updateRelativePosition(); 151 * Method: setSize 152 * Overridden here, because we need to update the blocks whenever the size 153 * of the popup has changed. 154 * 155 * Parameters: 156 * size - {<OpenLayers.Size>} 157 */ 158 setSize:function(size) { 159 OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); 160 161 this.updateBlocks(); 160 162 }, 161 163
