File tree Expand file tree Collapse file tree
src/wwwroot/js/genpage/gentab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1450,6 +1450,7 @@ class ImageCompareHelper {
14501450 this . getOverlay ( ) ?. style . setProperty ( '--image-compare-transparency' , `${ this . transparencyPercent / 100 } ` ) ;
14511451 } ) ;
14521452 this . updateModeControls ( ) ;
1453+ this . supportedTypes = [ 'image' , 'video' ] ;
14531454 }
14541455
14551456 getImgOrContainer ( ) {
@@ -2065,12 +2066,9 @@ class ImageCompareHelper {
20652066 if ( items . length > 2 ) {
20662067 return { state : 'invalid' , reason : 'Compare only supports exactly 2 selected items.' } ;
20672068 }
2068- if ( items [ 0 ] . mediaType == 'audio' || items [ 1 ] . mediaType == 'audio' ) {
2069+ if ( ! this . supportedTypes . includes ( items [ 0 ] . mediaType ) || ! this . supportedTypes . includes ( items [ 1 ] . mediaType ) ) {
20692070 return { state : 'invalid' , reason : 'Compare only supports images and videos.' } ;
20702071 }
2071- if ( items [ 0 ] . mediaType != items [ 1 ] . mediaType ) {
2072- return { state : 'invalid' , reason : 'Compare requires 2 items of the same media type.' } ;
2073- }
20742072 return { state : 'ready' , reason : 'Compare the selected items.' } ;
20752073 }
20762074}
You can’t perform that action at this time.
0 commit comments