Revision 82a5966d snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js | ||
---|---|---|
420 | 420 |
|
421 | 421 |
} |
422 | 422 |
|
423 |
// in a page with tabs, allow navigation with hash tags |
|
424 |
ui.hashViews = function(viewsEl, sectionEl){ |
|
425 |
var hash = window.location.hash; |
|
426 |
if (!(hash)){ |
|
427 |
return; |
|
428 |
} |
|
429 |
var link = viewsEl.find('a[href="'+hash+'"]'); |
|
430 |
console.log('link', link); |
|
431 |
if (link.length<=0){ |
|
432 |
return; |
|
433 |
} |
|
434 |
viewsEl.find('a span').removeClass('current'); |
|
435 |
link.find('span').addClass('current'); |
|
436 |
sectionEl.removeClass('grid-view list-view'); |
|
437 |
var sectionClass = hash.slice(1) + '-view'; |
|
438 |
sectionEl.addClass(sectionClass); |
|
439 |
} |
|
440 |
|
|
423 | 441 |
ui.ltBarToggle = function(speed){ |
424 | 442 |
|
425 | 443 |
var cmarg = parseInt($('.lt-bar').width()) - parseInt($('.toggle-lt-bar').outerWidth(true)); |
... | ... | |
718 | 736 |
/* grid/list view for items-list */ |
719 | 737 |
|
720 | 738 |
$('.actions-bar .list, .actions-bar .grid').click(function(e){ |
721 |
e.preventDefault(); |
|
739 |
//e.preventDefault();
|
|
722 | 740 |
if (!($(this).find('span').hasClass('current'))) { |
723 | 741 |
$('.actions-bar .grid span, .actions-bar .list span').removeClass('current'); |
724 | 742 |
$(this).find('span').addClass('current'); |
... | ... | |
827 | 845 |
}); |
828 | 846 |
ui.tabs($('.tabs'), $('.content')); |
829 | 847 |
ui.hashTabs($('.tabs'), $('.content')); |
848 |
ui.hashViews($('.actions-bar .rt-actions'), $('.entities')); |
|
830 | 849 |
|
831 | 850 |
$('.act').click(function(e) { |
832 | 851 |
$(this).addClass('pending last'); |
Also available in: Unified diff