ralphbean/tw2.jqplugins.ui — Issue #6: Second jquery-ui.css added if set_ui_theme_name called.
Author: scottawilliams71
Created: 2011-10-11 17:58:51+00:00
State: open

If set_ui_theme_name is called and specifies a different theme then the default, a second link to jquery-ui.css is added to the generated html, one with "smoothness", and one with the other theme, for example "sunny":

Problem appears to come from JQueryUIWidget class in tw2.jqplugins.ui.base.py, specifically this line:
resources = [ jquery_ui_js, jquery_ui_css ]

This adds a resource using the default theme. Later, when prepare is called, jquery_ui_css is appended to resources with the name of the theme:
self.resources.append(jquery_ui_css(name=get_ui_theme_name()))

Removing jquery_ui_css from the list originally assigned to resources resolves the issue.

tw2 versions:
tw2.core==2.0b8
tw2.forms==2.0b5
tw2.jqplugins.ui==2.0b21
tw2.jquery==2.0b9