Solved: How to check if a js library is loaded
Permalink
Some JQuery plugins, like Spritely, require jquery-ui for drag-drop for example. It seems C5 also includes this libary, but only when an admin is logged in (i.e. the tool header is displayed).
If the template includes the library, you may see a random empty dialog when you're logged in and visit a page using that template.
So what is the best way to selectively include the library? $c->isEditMode() won't work -- is there something similar that checks whether the tool header is displayed? I was thinking that $this->editingEnabled() would work, but it doesn't seem to... It seems to be returning true whether I'm logged in or not. I must be missing something obvious.
If the template includes the library, you may see a random empty dialog when you're logged in and visit a page using that template.
So what is the best way to selectively include the library? $c->isEditMode() won't work -- is there something similar that checks whether the tool header is displayed? I was thinking that $this->editingEnabled() would work, but it doesn't seem to... It seems to be returning true whether I'm logged in or not. I must be missing something obvious.
Should have checked before posting...