}
var root = $('body');
- var bar = $('<div class="servicesbar"></div>');
- var services = $('<div class="services"></div>');
+ var bar = $('<div class="cloudbar"></div>');
+ var services = $('<ul class="services"></ul>');
var profile = $('<div class="profile"></div>');
var get_services_url = window.GET_SERVICES_URL || window.CLOUDBAR_SERVICES;
// create services links and set the active class to the current service
$.getJSON(get_services_url + "?callback=?", function(data) {
$.each(data, function(i, el){
+ var sli = $("<li>");
var slink = $("<a>");
if (el.icon) {
slink.append($('<img src="'+cssloc+el.icon+'"/>'));
+ slink.addClass("with-icon");
} else {
slink.text(el.name);
}
slink.attr('href', el.url);
slink.attr('title', el.name);
- services.append(slink);
+ sli.append(slink);
+ services.append(sli);
if (el.id == ACTIVE_MENU) {
- slink.addClass("active");
+ sli.addClass("active");
}
});
});
if (i == 0){
username.text(el.name);
username.attr('href', el.url);
+ user.removeClass('full');
}else{
var link = $("<a />");
link.text(el.name);
var li = $("<li />");
li.append(link);
usermenu.append(li);
+ user.addClass('full');
}
});
});
user.append(username);
user.append(usermenu);
profile.append(user);
- bar.append(services).append(profile);
+ bar.append(profile).append(services);
root.prepend(bar);
// ie fix
user.hover(function(){$(this).addClass("hover")}, function(){$(this).removeClass("hover")});
+
+ /*$('.cloudbar .profile ul').mouseover(function(){
+ $(this).parents('.profile').css('backgroundColor','#000');
+
+ });
+ $('.cloudbar .profile ul').mouseout(function(){
+ $(this).parents('.profile').css('backgroundColor','#01A1AE');
+
+ });*/
+ $('.cloudbar .profile .full>a').live('click', function(e){
+ e.preventDefault();
+ $(this).siblings('ul').toggle();
+ $(this).toggleClass('open');
+ });
+
+ var profileWidth = profile.outerWidth();
+ $('.header .profile ul').css('width',profileWidth );
+
+
+
+
});