Orbit/app/assets/javascripts/lib/member/member.js

58 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

2013-08-30 08:47:44 +00:00
var H,P = [];
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() {
2013-08-30 08:47:44 +00:00
// 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);
// };
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))-
$('#orbit-bar').outerHeight(true);
2013-07-22 08:31:44 +00:00
$('#basic-info').height(H);
2013-08-30 08:47:44 +00:00
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top'))+20);
$('#module-content').height(H-$('#module-navbar .navbar').outerHeight(true)-$('.bottomnav').innerHeight());
2013-07-22 08:31:44 +00:00
};
$(function() {
checkHeight();
2013-08-30 08:47:44 +00:00
$('.wrap-inner').css('padding-bottom', 0);
$(window).resize(checkHeight);
2013-07-22 08:31:44 +00:00
$('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() {
return $(this).innerWidth()/2*-1;
})
})
2013-08-30 08:47:44 +00:00
// $('#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-08-30 08:47:44 +00:00
$('.member-avatar').rsImg();
$('#member-roles, #module-content .nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
});