pamelafox / font-previewer-extension

Google Font Previewer Chrome Extension
https://chrome.google.com/webstore/detail/engndlnldodigdjamndkplafgmkkencc
69 stars 14 forks source link

Fix subset dropdown #16

Closed jerboa88 closed 2 years ago

jerboa88 commented 2 years ago

Fixes for the subset dropdown as it doesn't work currently:

I also added an all entry to the dropdown so that users can view fonts from all subsets, but I left that change out of this PR because I'm not sure if that's something you want to include. If so, I can add a commit for it as it's only a couple of lines.

jerboa88 commented 2 years ago

Ah yes, I missed the call to loadVisibleFonts(). I removed the checks for the khmer subset and haven't seen any issues so I'm not sure what that was for either.

I added debouncing to the dropdown and searchbox because calling loadVisibleFonts() in the filterFonts() function made it 3-4x slower. It still ran okay on my machine but I'm sure that could have caused issues for ppl (I tried using throttle() for this but it calls the function immediately which isn't great when you're trying to type text).