diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtabview.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtabview.directive.js index 4b5ad2fd1a..32f384c4d9 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtabview.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtabview.directive.js @@ -26,13 +26,17 @@ angular.module("umbraco.directives") return; } - var bottom = bar.offset().top + bar.height(); - if(bottom > $(window).height()){ - bar.addClass("umb-bottom-bar"); - $(".tab-content .active").addClass("with-buttons"); - }else{ - bar.removeClass("umb-bottom-bar"); - $(".tab-content .active").removeClass("with-buttons"); + var offset = bar.offset(); + + if(offset){ + var bottom = bar.offset().top + bar.height(); + if(bottom > $(window).height()){ + bar.addClass("umb-bottom-bar"); + $(".tab-content .active").addClass("with-buttons"); + }else{ + bar.removeClass("umb-bottom-bar"); + $(".tab-content .active").removeClass("with-buttons"); + } } }