Commit 76afa573 authored by Dayton Johnson's avatar Dayton Johnson

MTC-1252: Removing cropper initialization check and replacing it with...

MTC-1252: Removing cropper initialization check and replacing it with disabling the slider element until initialization
parent 4cf3eabe
......@@ -344,7 +344,6 @@ module.exports={
var aspectDropId = "aspect-dropdown-" + modalId;
var aspectOptions=makeDropdown(aspectDropId, _.map(availableCroppings, (crop)=>{if(crop){return{title:crop.title, value:crop.aspect}}} ));
var revealFocalPoint = function () { window.alert("Can't reveal focal point") };
var isImageCropperInitialized = false;
var body=`
<div class="row" style="margin-top:.5rem;margin-bottom:.5rem;">
......@@ -369,7 +368,7 @@ module.exports={
<img class="crop-image" src="${selectedImagePath}" alt="Crop this image" style="max-height: calc(70vh - 60px);">
</div>
<div class="col s12">
<input class="zoom-slider no-materialize" type="range" min="0" max="100" step=".000001" value="0" style="width:100%; margin-top:15px;"/>
<input class="zoom-slider no-materialize" type="range" min="0" max="100" step=".000001" value="0" style="width:100%; margin-top:15px;" disabled/>
</div>
</div>
......@@ -432,11 +431,9 @@ module.exports={
$slider.on("input",function(){
var pct=$slider.val();
var zoom = (pct * (highestRatio - lowestRatio) / 100) + lowestRatio;
if (isImageCropperInitialized) {
$image.cropper("zoomTo", zoom);
var cropData = $image.cropper("getData");
setCropSize(cropData.width, cropData.height);
}
$image.cropper("zoomTo", zoom);
var cropData = $image.cropper("getData");
setCropSize(cropData.width, cropData.height);
})
$image.cropper({
......@@ -453,7 +450,7 @@ module.exports={
minCropBoxHeight: minHeight,
ready: function () {
isImageCropperInitialized = true;
$slider.attr('disabled', false);
$cropDialog.find(".set-focus").click(function(){
revealFocalPoint();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment