mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
Issue 2142: Sort components alphabetically
This commit is contained in:
parent
7b3d82fdf5
commit
a4849b5a1f
@ -97,7 +97,24 @@ if (location.hash !== '') {
|
|||||||
<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 $container = $('#componentContainer');
|
var $isotope = $('#componentContainer').isotope({
|
||||||
|
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'
|
||||||
|
});
|
||||||
|
|
||||||
function updateHash(newHash) {
|
function updateHash(newHash) {
|
||||||
if ('replaceState' in history) {
|
if ('replaceState' in history) {
|
||||||
@ -123,17 +140,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
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('.filter-button-group a').click(function() {
|
jQuery('.filter-button-group a').click(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user