Preview open in new tab instead of a popup (chrome)

This commit is contained in:
antoine
2014-08-08 13:14:03 +02:00
parent 9789fbdb79
commit 05c6166040

View File

@@ -263,20 +263,50 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, appS
$scope.preview = function (content) {
if (!$scope.busy) {
if (!$scope.busy) {
// Chromes popup blocker will kick in if a window is opened
// outwith the initial scoped request. This trick will fix that.
//
var previewWindow = $window.open('preview/?id=' + content.id, 'umbpreview');
$scope.save().then(function (data) {
// Chromes popup blocker will kick in if a window is opened
// outwith the initial scoped request. This trick will fix that.
//
var previewWindow = $window.open('preview/?id=' + content.id, 'umbpreview');
// Build the correct path so both /#/ and #/ work.
var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/?id=' + data.id;
var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/?id=' + data.id;
previewWindow.location.href = redirect;
});
}
}
//if (!$scope.busy) {
// $scope.save().then(function (data) {
// // Chromes popup blocker will kick in if a window is opened
// // outwith the initial scoped request. This trick will fix that.
// var previewWindow = $window.open("/umbraco/views/content/umbpreview.html", "umbpreview");
// // Build the correct path so both /#/ and #/ work.
// var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/dialogs/preview.aspx?id=' + data.id;
// previewWindow.location.href = redirect;
// });
//}
};
/** this method is called for all action buttons and then we proxy based on the btn definition */