Index: trunk/extensions/ImageMap/ImageMap_body.php |
— | — | @@ -276,23 +276,27 @@ |
277 | 277 | $xpath = new DOMXPath( $domDoc ); |
278 | 278 | $magnify = $xpath->query( '//div[@class="magnify"]' ); |
279 | 279 | if ( !$magnify->length && $descType != self::NONE ) { |
280 | | - $div->setAttribute( 'style', 'position: relative;' ); |
281 | | - |
282 | 280 | # Add image description link |
283 | 281 | if ( $descType == self::TOP_LEFT || $descType == self::BOTTOM_LEFT ) { |
284 | | - $descLeft = 0; |
| 282 | + $marginLeft = 0; |
285 | 283 | } else { |
286 | | - $descLeft = $thumbWidth - 20; |
| 284 | + $marginLeft = $thumbWidth - 20; |
287 | 285 | } |
288 | 286 | if ( $descType == self::TOP_LEFT || $descType == self::TOP_RIGHT ) { |
289 | | - $descTop = 0; |
| 287 | + $marginTop = -$thumbHeight; |
290 | 288 | } else { |
291 | | - $descTop = $thumbHeight - 20; |
| 289 | + $marginTop = -20; |
292 | 290 | } |
293 | | - $descAnchor = $div->appendChild( new DOMElement( 'a' ) ); |
| 291 | + $div->setAttribute( 'style', "height: {$thumbHeight}px" ); |
| 292 | + $descWrapper = $div->appendChild( new DOMElement( 'div' ) ); |
| 293 | + $descWrapper->setAttribute( 'style', |
| 294 | + "margin-left: {$marginLeft}px; " . |
| 295 | + "margin-top: {$marginTop}px; " |
| 296 | + ); |
| 297 | + |
| 298 | + $descAnchor = $descWrapper->appendChild( new DOMElement( 'a' ) ); |
294 | 299 | $descAnchor->setAttribute( 'href', $imageTitle->escapeLocalURL() ); |
295 | 300 | $descAnchor->setAttribute( 'title', wfMsgForContent( 'imagemap_description' ) ); |
296 | | - $descAnchor->setAttribute( 'style', "position:absolute; top: {$descTop}px; left: {$descLeft}px;" ); |
297 | 301 | $descImg = $descAnchor->appendChild( new DOMElement( 'img' ) ); |
298 | 302 | $descImg->setAttribute( 'alt', wfMsgForContent( 'imagemap_description' ) ); |
299 | 303 | $descImg->setAttribute( 'src', "$wgScriptPath/extensions/ImageMap/desc-20.png" ); |