Ignore:
Timestamp:
Feb 8, 2010, 3:23:01 AM (14 years ago)
Author:
gav
Message:

Add toggleWithImgAndEffect to JsUtil.
Replace control divs with our new JsUtil toggleControl taglib.
Small CSS adjustment to asset tree pane close.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/JsUtilTagLib.groovy

    r322 r323  
    2323    * @param openImgUrl The url to apply as the image src when toggled element is visible.
    2424    * @param closedImgUrl The url to apply as the image src when toggled element is hidden.
     25    * @param effect The effect to apply, 'fade' uses the fade/appear effect while the default is to just toggle.
    2526    * @param text The text, if any, to display.
    2627    */
     
    2829        def mkp = new groovy.xml.MarkupBuilder(out) //this line will be unnecessary in versions of Grails after version 1.2
    2930
     31        def toggleJs
     32
     33        // Do we want to fade/appear or just toggle.
     34        if(attrs.effect == "fade")
     35            toggleJs = js.toggleWithImgAndEffect(attrs.toggleId, attrs.imageId, attrs.openImgUrl, attrs.closedImgUrl)
     36        else
     37            toggleJs = js.toggleWithImg(attrs.toggleId, attrs.imageId, attrs.openImgUrl, attrs.closedImgUrl)
     38
    3039        mkp.div() {
    31             a( href: js.toggleWithImg(attrs.toggleId, attrs.imageId, attrs.openImgUrl, attrs.closedImgUrl) ) {
     40            a( href: toggleJs ) {
    3241                yieldUnescaped(attrs.text)
    3342                img(id: attrs.imageId, src: attrs.closedImgUrl, alt: "Show")
Note: See TracChangeset for help on using the changeset viewer.