orbit-basic/app/assets/javascripts/orbit-1.0.js

65 lines
1.7 KiB
JavaScript

var viewportwidth,
viewportheight;
function resize() {
viewportheight=$(window).height();
viewportwidth=$(window).width();
if(window.navigator.userAgent.indexOf("MSIE")>0){
windH=document.clientHeight;
windW=document.clientWidht;
}
}
$(document).ready(function(){
$(document).on('click', '.orbit-bar-member', function(){
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
$('.bar-login .dropdown-menu').toggle();
return false;
});
$(document).click(function() {
$('.orbit-bar-member').removeClass("open");
$('.bar-login .dropdown-menu').hide();
});
$(document).on('click', '.dropdown-menu', function(e) {
e.stopPropagation();
$('.bar-login .dropdown-menu').show();
});
$('.tip').tooltip({
placement: "left"
});
var $role = $('.select-role');
$('.privacy').each(function($i) {
$(this).click(function() {
switch ($i) {
case 0:
$role.slideUp(300);
break;
case 1:
$role.slideDown(300);
break;
}
});
});
/*tinyscrollbar&windows-Size*/
resize();
$('#main-sidebar').css("height", viewportheight-40);
//$('#content-wrap .viewport').css("height", viewportheight-44);
//$('#content-wrap').css("width", viewportwidth-186);
$('#main-sidebar .viewport').css("height", viewportheight-40);
$('.post-title').css("width", viewportwidth-495);
$('#main-sidebar').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({ size:(viewportheight-44)});
});
$(window).resize(function(){
resize();
$('#main-sidebar').css("height", viewportheight-40);
$('#main-sidebar .viewport').css("height", viewportheight-40);
$('.post-title').css("width", viewportwidth-495);
$('#main-sidebar').tinyscrollbar({ size:(viewportheight-44)});
});