ua-snap / ardac-explorer

ARDAC GUI Explorer
0 stars 0 forks source link

Add optional item priority field to control page sorting #21

Closed cstephen closed 8 months ago

cstephen commented 8 months ago

This PR adds an optional priority field for items. This field controls how items are ordered on the front/tag pages. Items without a priority field are sorted below all items that do have a priority field. Currently, lower priority numbers sort higher up on the page.

This works by first sorting the array of items as described above, and then taking advantage of Masonry's horizontalOrder option to keep higher priority elements at the top while still fitting things together in an optimal way.

To test, try setting the priority of items in items.js in different ways and make sure the items are sorted on the page(s) the way you'd expect. Try this on both the front page and the item pages. Browser reload may be required after changing items.js.