This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/resize/script.js
2017-09-17 15:09:25 +01:00

19 lines
529 B
JavaScript

$(function() {
var original_width = $("#original_width").val();
var original_height = $("#original_height").val();
$("#resize_width").change(function() {
if($("#resize_aspect").prop("checked")) {
$("#resize_height").val(
Math.round($("#resize_width").val() / original_width * original_height)
);
}
});
$("#resize_height").change(function() {
if($("#resize_aspect").prop("checked")) {
$("#resize_width").val(
Math.round($("#resize_height").val() / original_height * original_width)
);
}
});
});