File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -296,17 +296,20 @@ protected function setWrapperStyle() {
296296 }
297297 $ width = 480 ;
298298 $ 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+ }
305308 }
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 }%; " );
308312 }
309- $ this ->htmlOptions ['style ' ] = "width: {$ width }px; height: {$ height }px; " ;
310313 }
311314
312315 /**
Original file line number Diff line number Diff line change 11/*Plupload*/
2+ : root {
3+ --scalebox-ratio : 61.8% ;
4+ }
25
3- .plupload_wrapper {
6+ .plupload_wrapper {
47 position : relative;
58}
69.plupload_preview ,
164167.plupload_wrapper .plupload_one {
165168 border : 1px dashed # ccc ;
166169}
170+ .plupload_wrapper .plupload_one : after {
171+ padding-top : var (--scalebox-ratio );
172+ content : "" ;
173+ width : 100% ;
174+ display : block;
175+ }
167176.plupload_one .plupload_container {
177+ position : absolute;
168178 width : 100% ;
169179 height : 100% ;
170180}
You can’t perform that action at this time.
0 commit comments