orbit-basic/app/assets/javascripts/lib/member/member.js

55 lines
1.8 KiB
JavaScript
Raw Normal View History

2013-07-22 08:31:44 +00:00
// Go to
!function ($) {
$.fn.goTo = function (){
var $this = this,
$destination = $this.attr('href'),
$offset = $($destination).offset();
$this.on(clickEvent, function() {
$("html, body").animate({
scrollTop: $offset.top,
}, 500);
return false;
});
}
}(window.jQuery);
function checkHeight() {
if($('#member-module').height() > $(window).height()) {
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#orbit-bar').outerHeight(true);
}else{
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#filter').outerHeight()+
parseInt($('#filter').css('margin-bottom'))-
$('#orbit-bar').outerHeight(true);
};
$('#basic-info').height(H);
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top')))
};
$(function() {
var H;
checkHeight();
$(window).resize(function() {
checkHeight();
2013-08-09 07:07:05 +00:00
// setModuleBlockWidth();
2013-07-22 08:31:44 +00:00
});
$('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() {
return $(this).innerWidth()/2*-1;
})
})
$('#basic-info').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true)+20,
});
$('#module-navbar').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true),
});
2013-08-09 07:07:05 +00:00
// $('.member-avatar').imagesLoaded(function() {
// $('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
// });
2013-07-22 08:31:44 +00:00
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
})