Revision 904fd3cd
b/snf-astakos-app/astakos/im/static/im/cloudbar/cloudbar.js | ||
---|---|---|
53 | 53 |
// create services links and set the active class to the current service |
54 | 54 |
$.getJSON(get_services_url + "?callback=?", function(data) { |
55 | 55 |
$.each(data, function(i, el){ |
56 |
var sli = $("<li>"); |
|
56 |
var sli = $("<li class='service-"+el.name+"'>");
|
|
57 | 57 |
var slink = $("<a>"); |
58 | 58 |
if (!el.cloudbar) { el.cloudbar = {} } |
59 | 59 |
var title = el.cloudbar.name || el.verbose_name || el.name; |
b/snf-astakos-app/astakos/im/static/im/js/common.js | ||
---|---|---|
309 | 309 |
|
310 | 310 |
|
311 | 311 |
|
312 |
|
|
313 |
$('.landing-page .cms').hover( |
|
314 |
function () { |
|
315 |
el = $('.cloudbar ul.services li').first(); |
|
316 |
var offset = el.offset(); |
|
317 |
positionX = offset.left; |
|
318 |
$('#hand').css('left',positionX); |
|
319 |
$('#hand').show(); |
|
320 |
}, |
|
321 |
function () { |
|
322 |
$('#hand').hide(); |
|
323 |
|
|
324 |
}); |
|
325 |
|
|
326 |
$('.landing-page .pithos').hover( |
|
327 |
function () { |
|
328 |
el = $('.cloudbar ul.services li:nth-child(3)'); |
|
329 |
var offset = el.offset(); |
|
330 |
positionX = offset.left; |
|
331 |
left = parseInt(positionX) +20; |
|
332 |
$('#hand').css('left',left+'px'); |
|
333 |
$('#hand').show(); |
|
334 |
}, |
|
335 |
function () { |
|
336 |
$('#hand').hide(); |
|
337 |
|
|
338 |
}); |
|
339 |
|
|
340 |
$('.landing-page .cyclades').hover( |
|
341 |
function () { |
|
342 |
el = $('.cloudbar ul.services li:nth-child(2)').first(); |
|
343 |
var offset = el.offset(); |
|
344 |
positionX = offset.left; |
|
345 |
left = parseInt(positionX) +20; |
|
346 |
$('#hand').css('left',left+'px'); |
|
347 |
$('#hand').show(); |
|
348 |
}, |
|
349 |
function () { |
|
350 |
$('#hand').hide(); |
|
351 |
|
|
352 |
}); |
|
353 |
|
|
354 |
|
|
355 |
$('.landing-page .dashboard').hover( |
|
356 |
function () { |
|
357 |
el = $('.cloudbar .profile'); |
|
358 |
var offset = el.offset(); |
|
359 |
positionX = offset.left +50; |
|
360 |
$('#hand').css('left',positionX); |
|
361 |
$('#hand').show(); |
|
362 |
}, |
|
363 |
function () { |
|
312 |
// landing-page initialization |
|
313 |
if ($('.landing-page').length > 0) { |
|
314 |
var wrapper = $(".landing-page"); |
|
315 |
var services = wrapper.find(".landing-service"); |
|
316 |
services.hover(function(e) { |
|
317 |
var cls, service_cls, cloudbar_li, offset, positionX; |
|
318 |
cls = _.filter($(this).attr("class").split(" "), function(cls) { |
|
319 |
return cls.indexOf("service-") == 0 |
|
320 |
}); |
|
321 |
if (!cls.length) { return } |
|
322 |
service_cls = $.trim(cls[0]); |
|
323 |
extra = 0; |
|
324 |
if (service_cls == 'service-astakos') { |
|
325 |
cloudbar_li = $(".cloudbar .profile"); |
|
326 |
extra = 50; |
|
327 |
} else { |
|
328 |
cloudbar_li = $(".cloudbar ul.services li." + service_cls); |
|
329 |
if (cloudbar_li.index() != 0) { |
|
330 |
extra = 20; |
|
331 |
} |
|
332 |
} |
|
333 |
offset = cloudbar_li.offset(); |
|
334 |
if (!offset) { return } |
|
335 |
positionX = offset.left + extra; |
|
336 |
$('#hand').css('left',positionX + 'px'); |
|
337 |
$('#hand').show(); |
|
338 |
}, function (e) { |
|
364 | 339 |
$('#hand').hide(); |
365 |
|
|
366 |
});
|
|
367 |
|
|
340 |
}); |
|
341 |
} |
|
342 |
|
|
368 | 343 |
$('.pagination a.disabled').click(function(e){ |
369 | 344 |
e.preventDefault(); |
370 | 345 |
}); |
b/snf-astakos-app/astakos/im/templates/im/landing_base.html | ||
---|---|---|
7 | 7 |
<div class="landing-page"> |
8 | 8 |
{% for id, service in services.items %} |
9 | 9 |
{% if service.dashboard.show %} |
10 |
<div class="two-cols clearfix dotted {{ id }}"> |
|
10 |
<div class="two-cols clearfix dotted {{ id }} service-{{ id }} |
|
11 |
landing-service"> |
|
11 | 12 |
<div class="rt"> |
12 | 13 |
{% if service.url %} |
13 | 14 |
<a href="{{ service.url }}"> |
14 | 15 |
{% endif %} |
15 |
<img class="pic" src="{{ IM_STATIC_URL }}images/landing-{{ id }}.png" />
|
|
16 |
<img class="pic" src="{% if service.dashboard.icon %}{{ service.dashboard.icon }}{% else %}{{ IM_STATIC_URL }}images/landing-{{ id }}.png{% endif %}" />
|
|
16 | 17 |
{% if service.url %} |
17 | 18 |
</a> |
18 | 19 |
{% endif %} |
... | ... | |
29 | 30 |
$('body').append('<div id="hand"> </div>'); |
30 | 31 |
}); |
31 | 32 |
</script> |
32 |
{% endblock %} |
|
33 |
{% endblock %} |
Also available in: Unified diff