开发者

grails + jquery ui plugin, using custom theme

开发者 https://www.devze.com 2023-02-19 16:31 出处:网络
reading the docs here:http://grails.org/plugin/jquery-ui it says to use a custom theme I should put the theme at:

reading the docs here:http://grails.org/plugin/jquery-ui

it says to use a custom theme I should put the theme at:

webapp/jquery-ui/themes/{theme-name}/jquery-ui-1.8.10.custom.css

When I apply the tag in my main.gsp:

<jqui:resources theme="le-frog" />

Launch and Tomcat can't find the file. The tag seems to point to:

/myapp/plugins/jquery-ui-1.8.10/jquery-ui/themes/le-frog/jquery-ui-1.8.10.custom.css

Unless there's some magic going on (and I think there is) I can understand why this clearly doesn't work. If I point the browser directly to the file, i.e. put this in the address bar:

http://localhost:8080/my开发者_如何学Goapp/jquery-ui/themes/le-frog/jquery-ui-1.8.10.custom.css

Then it finds the file. What am I doing wrong?


The problem is with this line in the plugin source

JqueryUiTagLib.groovy line 113

url = g.resource(plugin:attrs.remove('plugin'), dir:attrs.remove('dir'), file:attrs.remove('file'))

If you remove the plugin attribute, the link is rendered correctly. I think what the plugins should do is if the theme attribute to jqui:resource is present, it should leave that plugin attribute off the url generation (see line 113). If the theme attribute is absent, load the default ui-lightness theme which comes with the plugin, which would require the plugin attribute.

Hope that makes sense. Should probably submit a patch to the plugin creator or just let them know.

0

精彩评论

暂无评论...
验证码 换一张
取 消