Compare commits

...

3 Commits

2 changed files with 62 additions and 45 deletions
@@ -208,6 +208,7 @@ Opens an overlay to show a custom YSOD. </br>
var numberOfOverlays = 0;
var isRegistered = false;
var modelCopy = {};
var unsubscribe = [];
@@ -221,8 +222,23 @@ Opens an overlay to show a custom YSOD. </br>
$timeout(function() {
if (scope.position === "target") {
if (scope.position === "target" && scope.model.event) {
setTargetPosition();
// update the position of the overlay on content changes
// as these affect the layout/size of the overlay
if ('ResizeObserver' in window)
{
var resizeObserver = new ResizeObserver(setTargetPosition);
var contentArea = document.getElementById("contentwrapper");
resizeObserver.observe(el[0]);
if (contentArea) {
resizeObserver.observe(contentArea);
}
unsubscribe.push(function () {
resizeObserver.disconnect();
});
}
}
// this has to be done inside a timeout to ensure the destroy
@@ -397,9 +413,6 @@ Opens an overlay to show a custom YSOD. </br>
bottom: "inherit"
};
// if mouse click position is know place element with mouse in center
if (scope.model.event && scope.model.event) {
// click position
mousePositionClickX = scope.model.event.pageX;
mousePositionClickY = scope.model.event.pageY;
@@ -438,9 +451,6 @@ Opens an overlay to show a custom YSOD. </br>
}
el.css(position);
}
}
scope.submitForm = function(model) {
@@ -249,8 +249,14 @@
};
scope.openCompositionsDialog = function() {
scope.isCompositionsDialogLoading = false;
scope.openCompositionsDialog = function() {
if (scope.isCompositionsDialogLoading) {
return;
}
scope.isCompositionsDialogLoading = true;
scope.compositionsDialogModel = {
contentType: scope.model,
compositeContentTypes: scope.model.compositeContentTypes,
@@ -267,7 +273,7 @@
// remove overlay
editorService.close();
scope.isCompositionsDialogLoading = false;
},
close: function(oldModel) {
@@ -277,7 +283,7 @@
// remove overlay
editorService.close();
scope.isCompositionsDialogLoading = false;
},
selectCompositeContentType: function (selectedContentType) {
@@ -356,6 +362,7 @@
scope.compositionsDialogModel.totalContentTypes = parseInt(result, 10);
})
]).then(function() {
scope.isCompositionsDialogLoading = false;
//resolves when both other promises are done, now show it
editorService.open(scope.compositionsDialogModel);
scope.compositionsButtonState = "init";