From bb4f0404b41635221f59fea137526caea42b0d44 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Thu, 9 Apr 2015 14:16:04 +0200 Subject: Speed up sorting by only sorting the current album --- js/galleryview.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/galleryview.js') diff --git a/js/galleryview.js b/js/galleryview.js index 0182c3ce..ba9548d4 100644 --- a/js/galleryview.js +++ b/js/galleryview.js @@ -64,8 +64,16 @@ Gallery.view.viewAlbum = function (albumPath) { Gallery.currentAlbum = albumPath; Gallery.view.shareButtonSetup(albumPath); Gallery.view.infoButtonSetup(); + Gallery.view.breadcrumb = new Gallery.Breadcrumb(albumPath); Gallery.view.breadcrumb.setMaxWidth($(window).width() - 320); + + var currentSort = Gallery.albumConfig.getAlbumSorting(); + Gallery.view.sortControlsSetup(currentSort.type, currentSort.order); + Gallery.albumMap[Gallery.currentAlbum].images.sort(Gallery.sortBy(currentSort.type, + currentSort.order)); + Gallery.albumMap[Gallery.currentAlbum].subAlbums.sort(Gallery.sortBy('name', + currentSort.albumOrder)); } Gallery.albumMap[albumPath].viewedItems = 0; -- cgit v1.2.3