UAASSCRUM-1405 Clean up preview for Headless

This commit is contained in:
Claus
2018-02-27 15:47:47 +01:00
parent 7ee510ed38
commit 9c8c9d8a39
5 changed files with 55 additions and 11 deletions

View File

@@ -242,10 +242,10 @@
// Chromes popup blocker will kick in if a window is opened
// without the initial scoped request. This trick will fix that.
//
var previewWindow = $window.open('preview/?init=true&id=' + content.id, 'umbpreview');
var previewWindow = $window.open('previews/?init=true&id=' + content.id, 'umbpreview');
// Build the correct path so both /#/ and #/ work.
var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/?id=' + content.id;
var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/previews/?id=' + content.id;
//The user cannot save if they don't have access to do that, in which case we just want to preview
//and that's it otherwise they'll get an unauthorized access message
@@ -255,11 +255,9 @@
else {
$scope.save().then(function (data) {
previewWindow.location.href = redirect;
});
});
}
}
};
$scope.restore = function (content) {