#U4-5530 Fixed Due in version: 7.2.0

Check if getElementById actually has a result before using it
This commit is contained in:
Sebastiaan Janssen
2014-09-22 15:38:38 +02:00
parent b433d0a35c
commit 357187a7fd

View File

@@ -314,7 +314,8 @@ var app = angular.module("umbraco.tuning", ['spectrumcolorpicker', 'ui.slider',
var hideUmbracoPreviewBadge = function () {
var iframe = (document.getElementById("resultFrame").contentWindow || document.getElementById("resultFrame").contentDocument);
iframe.document.getElementById("umbracoPreviewBadge").style.display = "none";
if(iframe.document.getElementById("umbracoPreviewBadge"))
iframe.document.getElementById("umbracoPreviewBadge").style.display = "none";
}
$scope.openIntelTuning = function () {
@@ -439,7 +440,8 @@ var app = angular.module("umbraco.tuning", ['spectrumcolorpicker', 'ui.slider',
link: function (scope, element, attr) {
element.load(function () {
var iframe = (element.context.contentWindow || element.context.contentDocument);
iframe.document.getElementById("umbracoPreviewBadge").style.display = "none";
if(iframe.document.getElementById("umbracoPreviewBadge"))
iframe.document.getElementById("umbracoPreviewBadge").style.display = "none";
if (!document.getElementById("resultFrame").contentWindow.refrechLayout) {
scope.frameLoaded = true;
scope.$apply();