From cb491d45ab149be6b00f7f74d7226198e8d90bed Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 10 Jun 2014 16:50:03 +0200 Subject: [PATCH 1/3] open preview issue fixed --- .../src/views/content/content.edit.controller.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js index 6a80b5255d..cab656d24b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js @@ -261,9 +261,15 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, appS return performSave({ saveMethod: contentResource.save, statusMessage: "Saving..." }); }; - $scope.preview = function(content){ + $scope.preview = function (content) { + // 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) { - $window.open('preview/?id=' + data.id, 'umbpreview'); + // Build the correct path so both /#/ and #/ work. + var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/?id=' + data.id; + previewWindow.location.href = redirect; }); }; From 9da7e108da0a0618ff7d7b7799672f0f886445d5 Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 10 Jun 2014 16:52:29 +0200 Subject: [PATCH 2/3] double )) in embed open windows --- .../src/views/propertyeditors/grid/editors/embed.html | 2 +- src/Umbraco.Web.UI/Umbraco/preview/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.html index 3e01a4888d..f9d7abffa0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.html @@ -1,6 +1,6 @@
-
+
Click to embed
diff --git a/src/Umbraco.Web.UI/Umbraco/preview/index.html b/src/Umbraco.Web.UI/Umbraco/preview/index.html index b44c80ad22..3c894c8038 100644 --- a/src/Umbraco.Web.UI/Umbraco/preview/index.html +++ b/src/Umbraco.Web.UI/Umbraco/preview/index.html @@ -7,7 +7,7 @@ - +
Loading ...
From 3b95184f0400e095e1307f5c436adaf242e74927 Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 10 Jun 2014 17:06:13 +0200 Subject: [PATCH 3/3] empty video or media issue --- .../Views/Partials/Grid/bootstrap3.cshtml | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml index a44f1a973f..284a8423c3 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml @@ -36,17 +36,19 @@ break; case "macro": + if (control.value != null) + { + string macroAlias = control.value.macroAlias.ToString(); + ViewDataDictionary parameters = new ViewDataDictionary(); + foreach (dynamic mpd in control.value.marcoParamsDictionary) + { + parameters.Add(mpd.Name, mpd.Value); + } - string macroAlias = control.value.macroAlias.ToString(); - ViewDataDictionary parameters = new ViewDataDictionary(); - foreach (dynamic mpd in control.value.marcoParamsDictionary) - { - parameters.Add(mpd.Name, mpd.Value); + + @Umbraco.RenderMacro(macroAlias, parameters) + } - - - @Umbraco.RenderMacro(macroAlias, parameters) - break; case "textstring": @@ -71,12 +73,15 @@ break; case "media": -
- -
- @if (control.value.caption != null) - { -

@control.value.caption

+ @if (control.value != null) + { +
+ +
+ if (control.value.caption != null) + { +

@control.value.caption

+ } }
break;