Improved anime list rendering
This commit is contained in:
14
utils/ItemCSSClass.go
Normal file
14
utils/ItemCSSClass.go
Normal file
@ -0,0 +1,14 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
// ItemCSSClass removes mountable class if the list has too many items.
|
||||
func ItemCSSClass(list *arn.AnimeList, index int) string {
|
||||
if index > 20 || len(list.Items) > 50 {
|
||||
return "anime-list-item"
|
||||
}
|
||||
|
||||
return "anime-list-item mountable"
|
||||
}
|
Reference in New Issue
Block a user