diff --git a/src/Umbraco.Web.UI.Client/src/tuning/tuning.front.js b/src/Umbraco.Web.UI.Client/src/tuning/tuning.front.js index 8b50cf1b58..089ff4d97a 100644 --- a/src/Umbraco.Web.UI.Client/src/tuning/tuning.front.js +++ b/src/Umbraco.Web.UI.Client/src/tuning/tuning.front.js @@ -276,11 +276,13 @@ var initTuningPanel = function () { $(function () { - // Init ouline layer - $("body").append("
"); + if (parent.setFrameIsLoaded) { + // Init ouline layer + $("body").append(""); - // Init tuning panel - initTuningPanel(); + // Init tuning panel + initTuningPanel(); + } }); diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index e9578c9be2..a7d018cfeb 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -1328,21 +1328,23 @@ namespace Umbraco.Web int pageId = UmbracoContext.PublishedContentRequest.UmbracoPage.PageID; string[] path = UmbracoContext.PublishedContentRequest.UmbracoPage.SplitPath; string result = string.Empty; + string cssPath = TuningUtility.GetStylesheetPath(path, false); if (UmbracoContext.Current.InPreviewMode) { tuningConfigPath = !string.IsNullOrEmpty(tuningConfigPath) ? tuningConfigPath : "/umbraco/js/tuning.config.js"; tuningPalettesPath = !string.IsNullOrEmpty(tuningPalettesPath) ? tuningConfigPath : "/umbraco/js/tuning.palettes.js"; - result = string.Format(previewLink, tuningConfigPath, tuningPalettesPath, pageId); + + if (!string.IsNullOrEmpty(cssPath)) + result = string.Format(noPreviewLinks, cssPath) + Environment.NewLine; + + result = result + string.Format(previewLink, tuningConfigPath, tuningPalettesPath, pageId); } else { // Get css path for current page - string cssPath = TuningUtility.GetStylesheetPath(path, false); if (!string.IsNullOrEmpty(cssPath)) result = string.Format(noPreviewLinks, cssPath); - else - result = string.Format(noPreviewLinks, "/Umbraco/assets/css/tuning.defaultStyle.css"); } return new HtmlString(result);