Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

theme fallback, general utils file #85

Merged
merged 1 commit into from
Jul 25, 2011
Merged

theme fallback, general utils file #85

merged 1 commit into from
Jul 25, 2011

Conversation

dtan
Copy link
Collaborator

@dtan dtan commented Jul 25, 2011

I ran into this problem today when i updated my dev branch and forgot that I had renamed my current working theme. the site borked on reload so i figured out a way to get it back to a working order so at least you can change your theme back.

I also added a general utils file (lib/Utils.js). right now it has to methods: hasProperty and getProperty (not DRY atm). This helps eliminate a statement like this:

if(calipso.theme.cache.modules && calipso.theme.cache.modules[module.name] && calipso.theme.cache.modules[module.name].templates[templateName]) { ... }

instead, it can now be written like this:

var hasTemplate = calipso.utils.hasProperty('theme.cache.modules.' + module.name + '.templates.' + templateName, calipso);

if (hasTemplate) { ... } 

…o site doesnt choke on server restart, added a general utility file (finding namespaced objects is a lot easier now)
cliftonc added a commit that referenced this pull request Jul 25, 2011
theme fallback, general utils file
@cliftonc cliftonc merged commit 3c55be2 into cliftonc:master Jul 25, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants