snap to bottom buttons fix on resize

This commit is contained in:
perploug
2013-11-04 14:57:13 +01:00
parent f342b80e86
commit 2d53aca29c

View File

@@ -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");
}
}
}