GuestPreferences Theme Toggler Incompatible with OmniFaces ResourceCombiner

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
cstraw
Posts: 2
Joined: 20 Oct 2020, 17:15

21 Oct 2020, 00:33

Love the library and the themes. Figured it was time to give back so I just ponied up money for a PRO theme and had an issue where the theme would not toggle properly after installing the templates.

Source of the issue was the following in changeComponentsTheme function of layout.js

Code: Select all

        var linkElement = $('link[href*="theme.css"]');
        var href = linkElement.attr('href');
        
Omnifaces's CombinedResourceHandler smashes all of the stylesheets together, so this javascript DOM lookup of linkElement returns a NULL, causing the href variable assignment to fail.

I just turned off CombinedResourceHandler for the time being to resolve the issue, as I realize it may simply not be compatible with your otherwise admirable solution for swapping out style sheets on the fly.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

21 Oct 2020, 14:36

Hi,

Firstly, thank a lot for your attention!

Code: Select all

Source of the issue was the following in changeComponentsTheme function of layout.js
Omnifaces's CombinedResourceHandler smashes all of the stylesheets together, so this javascript DOM lookup of linkElement returns a NULL, causing the href variable assignment to fail.
- Will you use the Freya's configurator in your project? It has been written specifically for this layout. You may need to rewrite our PrimeFaces.FreyaConfigurator in layout.js if you want to use it with different structures.

I don't know exactly how CombinedResourceHandler creates style tags. Therefore, you can check them and update FreyaConfigurator's replace methods.

Best Regards,

Post Reply

Return to “Freya - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests