fixes datatype editor buttons not snapping to buttom
This commit is contained in:
@@ -4,11 +4,59 @@
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives.html")
|
||||
.directive('umbPanel', function(){
|
||||
.directive('umbPanel', function($timeout){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/html/umb-panel.html'
|
||||
templateUrl: 'views/directives/html/umb-panel.html',
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
function _setClass(resize){
|
||||
var bar = $(".tab-content .active .umb-tab-buttons");
|
||||
|
||||
//incase this runs without any tabs
|
||||
if(bar.length === 0){
|
||||
bar = $(".tab-content .umb-tab-buttons");
|
||||
}
|
||||
|
||||
//no need to process
|
||||
if(resize){
|
||||
bar.removeClass("umb-bottom-bar");
|
||||
}
|
||||
|
||||
//already positioned
|
||||
if(bar.hasClass("umb-bottom-bar")){
|
||||
return;
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//initial loading
|
||||
$timeout(function(){
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
_setClass();
|
||||
});
|
||||
_setClass();
|
||||
}, 1000, false);
|
||||
|
||||
|
||||
$(window).bind("resize", function () {
|
||||
_setClass(true);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -9,50 +9,6 @@ angular.module("umbraco.directives")
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-tab-view.html',
|
||||
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
function _setClass(resize){
|
||||
var bar = $(".tab-content .active .umb-tab-buttons");
|
||||
|
||||
//no need to process
|
||||
if(resize){
|
||||
bar.removeClass("umb-bottom-bar");
|
||||
}
|
||||
|
||||
//already positioned
|
||||
if(bar.hasClass("umb-bottom-bar")){
|
||||
return;
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//initial loading
|
||||
$timeout(function(){
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
_setClass();
|
||||
});
|
||||
|
||||
_setClass();
|
||||
}, 500, false);
|
||||
|
||||
$(window).bind("resize", function () {
|
||||
_setClass(true);
|
||||
});
|
||||
}
|
||||
templateUrl: 'views/directives/umb-tab-view.html'
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user