Skip to content

Commit

Permalink
Merge pull request owncloud#577 from viraj96/job4
Browse files Browse the repository at this point in the history
Only show sort buttons if there is more than 1 image in the album.
  • Loading branch information
oparoz committed Mar 11, 2016
2 parents 0cb11c0 + b4c8794 commit 7055f6d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions js/galleryview.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,20 @@

var availableWidth = $(window).width() - Gallery.buttonsWidth;
this.breadcrumb.init(albumPath, availableWidth);

$('#sort-name-button').show();
$('#sort-date-button').show();
var album = Gallery.albumMap[albumPath];

var sum = album.images.length + album.subAlbums.length;
//If sum of the number of images and subalbums exceeds 1 then show the buttons.
if(sum > 1)
{
$('#sort-name-button').show();
$('#sort-date-button').show();
}
else
{
$('#sort-name-button').hide();
$('#sort-date-button').hide();
}
var currentSort = Gallery.config.albumSorting;
this.sortControlsSetup(currentSort.type, currentSort.order);
Gallery.albumMap[Gallery.currentAlbum].images.sort(
Expand Down

0 comments on commit 7055f6d

Please sign in to comment.