waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
452 stars 71 forks source link

Default sorting #42

Closed JesseRiemens closed 2 years ago

JesseRiemens commented 2 years ago

Hi! Just implemented this project on my self hosted website in an evening and I love it! There's one thing that I kind of miss: default sorting. Now the sorting is new->old (as far as I can see) but this does not work for the pictures of my wedding. I would like to show them old->new. Is this something that I could easily add?

Thanks! Jesse

waschinski commented 2 years ago

Hey there! I am afraid this currently is not an option. You could enable ALLOW_ORDER_SORT_CHANGE though which will show a button so your wedding guests can switch the sorting order on their own.

If you don't mind a little hack, you could even try changing the /_includes/javascript.html file and add a few lines right before the lazyload(); call like that:

      document.addEventListener('load', (event) => {
          reverseSorting();
      }

Just an idea and not tested!

Anyway, this sounds like a nice and relatively simple feature to be added in the future.

JesseRiemens commented 2 years ago

Thanks! I'll try that and report back!

JesseRiemens commented 2 years ago

That almost works, with a small edit it works fine!

I added this on line 177: document.addEventListener('load', (event) => { reverseSorting(); }, true); Thanks again!

waschinski commented 2 years ago

43 is merged and will be included in new releases.