Merge pull request #1530 from umbraco/temp-U4-8769

fixes: U4-8769 ImageCropper focal points randomly sets to 'null'
This commit is contained in:
Stephan
2016-10-19 09:01:55 +02:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -118,9 +118,13 @@ angular.module("umbraco.directives")
$timeout(function(){
setDimensions();
});
var offsetX = $overlay[0].offsetLeft;
var offsetY = $overlay[0].offsetTop;
calculateGravity(offsetX, offsetY);
// Make sure we can find the offset values for the overlay(dot) before calculating
// fixes issue with resize event when printing the page (ex. hitting ctrl+p inside the rte)
if($overlay.is(':visible')) {
var offsetX = $overlay[0].offsetLeft;
var offsetY = $overlay[0].offsetTop;
calculateGravity(offsetX, offsetY);
}
});
});

View File

@@ -20,6 +20,8 @@ angular.module("umbraco.directives")
var curr = $(event.target); // active tab
var prev = $(event.relatedTarget); // previous tab
$scope.$apply();
for (var c in callbacks) {
callbacks[c].apply(this, [{current: curr, previous: prev}]);
}