mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Merge pull request #2277 from bdurrer/issue-2142
Issue 2142: Sort components alphabetically
This commit is contained in:
commit
6ee5f72b21
@ -114,8 +114,24 @@ Support for these components is provided by the Home Assistant community.
|
|||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(window).load(function(){
|
$(window).load(function(){
|
||||||
|
var $isotope = $('#componentContainer').isotope({
|
||||||
var $container = $('#componentContainer');
|
filter: '.featured',
|
||||||
|
animationOptions: {
|
||||||
|
duration: 750,
|
||||||
|
easing: 'linear',
|
||||||
|
queue: false
|
||||||
|
},
|
||||||
|
masonry: {
|
||||||
|
columnWidth: 210
|
||||||
|
},
|
||||||
|
getSortData: {
|
||||||
|
title: function( itemElem ) {
|
||||||
|
var title = $( itemElem ).find('.title').text();
|
||||||
|
return title ? title.toLowerCase() : '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sortBy: 'title'
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update the browser location hash. This enables users to use the browser-history
|
* update the browser location hash. This enables users to use the browser-history
|
||||||
@ -170,17 +186,9 @@ $(window).load(function(){
|
|||||||
$('.filter-button-group a.current').removeClass('current');
|
$('.filter-button-group a.current').removeClass('current');
|
||||||
$('.filter-button-group a[href="'+hash+'"]').addClass('current');
|
$('.filter-button-group a[href="'+hash+'"]').addClass('current');
|
||||||
|
|
||||||
$container.isotope({
|
$isotope.isotope({
|
||||||
filter: filter,
|
filter: filter
|
||||||
animationOptions: {
|
});
|
||||||
duration: 750,
|
|
||||||
easing: 'linear',
|
|
||||||
queue: false
|
|
||||||
},
|
|
||||||
masonry: {
|
|
||||||
columnWidth: 210
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update view by filter selection
|
// update view by filter selection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user