Skip to content

Commit ef6be0d

Browse files
committed
add comments
1 parent b185941 commit ef6be0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web_src/js/features/imagediff.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,11 @@ export function initImageDiff() {
256256
height: sizes.size2.height * factor + 2
257257
});
258258

259+
// some inner elements are `position: absolute`, so the container's height must be large enough
260+
// the "css(width, height)" is somewhat hacky and not easy to understand, it could be improved in the future
259261
sizes.image2.parent().parent().css({
260262
width: sizes.max.width * factor + 2,
261-
height: sizes.max.height * factor + 2 + 20,
263+
height: sizes.max.height * factor + 2 + 20 /* extra height for inner "position: absolute" elements */,
262264
});
263265

264266
const $range = $container.find("input[type='range']");

0 commit comments

Comments
 (0)