@@ -99,16 +99,17 @@ Class.create("IMagickPreviewer", Diaporama, {
99
99
align :'absmiddle' ,
100
100
src :IMagickPreviewer . prototype . getThumbnailSource ( ajxpNode )
101
101
} ) ;
102
- img . resizePreviewElement = function ( dimensionObject ) {
102
+ var div = new Element ( 'div' ) ;
103
+ div . insert ( img ) ;
104
+ div . resizePreviewElement = function ( dimensionObject ) {
103
105
var ratio = img . ratio ;
104
106
if ( ! ratio ) {
105
107
var fakeIm = new Image ( ) ;
106
108
fakeIm . onload = function ( ) {
107
109
img . ratio = fakeIm . width / fakeIm . height ;
108
- img . resizePreviewElement ( dimensionObject ) ;
110
+ div . resizePreviewElement ( dimensionObject ) ;
109
111
} ;
110
112
fakeIm . src = img . src ;
111
- //img.onload = function(){img.resizePreviewElement(dimensionObject);};
112
113
ratio = 1.0 ;
113
114
}
114
115
var imgDim = {
@@ -117,6 +118,13 @@ Class.create("IMagickPreviewer", Diaporama, {
117
118
} ;
118
119
var styleObj = fitRectangleToDimension ( imgDim , dimensionObject ) ;
119
120
img . setStyle ( styleObj ) ;
121
+ div . setStyle ( {
122
+ height :styleObj . height ,
123
+ width :styleObj . width ,
124
+ /*position:'relative',*/
125
+ display :'inline'
126
+ } ) ;
127
+ if ( $ ( div . parentNode ) ) $ ( div . parentNode ) . setStyle ( { position :"relative" } ) ;
120
128
} ;
121
129
img . observe ( "mouseover" , function ( event ) {
122
130
var theImage = event . target ;
@@ -159,7 +167,7 @@ Class.create("IMagickPreviewer", Diaporama, {
159
167
if ( theImage . up ( '.thumbnail_selectable_cell' ) ) return ;
160
168
theImage . previewOpener . setStyle ( { display :'none' } ) ;
161
169
} ) ;
162
- return img ;
170
+ return div ;
163
171
} ,
164
172
165
173
getRESTPreviewLinks :function ( node ) {
0 commit comments