Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fonts cannot be applied on second page load. #12

Closed
androidacy-user opened this issue May 18, 2021 · 4 comments
Closed

[BUG] Fonts cannot be applied on second page load. #12

androidacy-user opened this issue May 18, 2021 · 4 comments

Comments

@androidacy-user
Copy link
Contributor

The plugin works great on first page load.

However on second I get the error fontType is not defined.

I'm not sure if this is some weird issue with caching or what.

@av01d
Copy link
Owner

av01d commented May 18, 2021

I can't reproduce on the demo page: https://av01d.github.io/fontpicker-jquery-plugin/index.html
Can you make a fiddle or other demo that shows the bug?
Also: what browser did you use?

@androidacy-user
Copy link
Contributor Author

I can only reproduce with the minified version from this repository. Minifying the normal version via YUI works fine.

I'm not sure if GitHub is mangling it on download or what (I used wget to download directly from GitHub on my server) but the end result seems to be 200+ lines, lol.

Assuming it was some weird screwup somewhere and closing.

@ErikLtz
Copy link

ErikLtz commented Jun 8, 2021

Believe I had exactly this issue too. Added var before fontType, also fontFamily and font in the minified version inside function getFavorites - which explain it works FIRST time when there are no favorites but gives error when there are. This code at line 5981 in the non minified version:

tmp = fonts[f].split(':'), fontType = tmp[0], fontFamily = tmp[1], font = this.allFonts[fontType][fontFamily];

(sorry to comment on a closed issue, but I believe this is still an "open issue" as I just downloaded the most recent version, installed the minified code and got the error after the initial selection of a font - when there is a favorite cookie to process in getFavorites)

@av01d
Copy link
Owner

av01d commented Jun 9, 2021

Thanks for betting back to me! Yes, there was indeed an issue with some undeclared variables, which caused havoc in the minified version (due to use strict).
All has now been fixed, properly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants