File tree 2 files changed +23
-10
lines changed
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -296,17 +296,20 @@ protected function setWrapperStyle() {
296
296
}
297
297
$ width = 480 ;
298
298
$ height = 300 ;
299
- if (isset ($ this ->options ['resize ' ]) && !empty ($ resize = $ this ->options ['resize ' ])) {
300
- $ width = !isset ($ resize ['width ' ]) ?: $ resize ['width ' ];
301
- $ height = !isset ($ resize ['height ' ]) ?: $ resize ['height ' ];
302
- }
303
- if (isset ($ this ->wrapperOptions ['width ' ])) {
304
- $ width = (int ) $ this ->wrapperOptions ['width ' ];
299
+ if (!empty ($ this ->resize )) {
300
+ $ _w = ArrayHelper::getValue ($ this ->resize , 'width ' );
301
+ $ _h = ArrayHelper::getValue ($ this ->resize , 'height ' );
302
+ if ($ _w ) {
303
+ $ width = $ _w ;
304
+ }
305
+ if ($ _h ) {
306
+ $ height = $ _h ;
307
+ }
305
308
}
306
- if (isset ($ this ->wrapperOptions ['height ' ])) {
307
- $ height = (int ) $ this ->wrapperOptions ['height ' ];
309
+ if ($ width ) {
310
+ $ scale = $ height / $ width * 100 ;
311
+ Html::addCssStyle ($ this ->htmlOptions , "--scalebox-ratio: {$ scale }%; " );
308
312
}
309
- $ this ->htmlOptions ['style ' ] = "width: {$ width }px; height: {$ height }px; " ;
310
313
}
311
314
312
315
/**
Original file line number Diff line number Diff line change 1
1
/*Plupload*/
2
+ : root {
3
+ --scalebox-ratio : 61.8% ;
4
+ }
2
5
3
- .plupload_wrapper {
6
+ .plupload_wrapper {
4
7
position : relative;
5
8
}
6
9
.plupload_preview ,
164
167
.plupload_wrapper .plupload_one {
165
168
border : 1px dashed # ccc ;
166
169
}
170
+ .plupload_wrapper .plupload_one : after {
171
+ padding-top : var (--scalebox-ratio );
172
+ content : "" ;
173
+ width : 100% ;
174
+ display : block;
175
+ }
167
176
.plupload_one .plupload_container {
177
+ position : absolute;
168
178
width : 100% ;
169
179
height : 100% ;
170
180
}
You can’t perform that action at this time.
0 commit comments