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/services/JsUtilService.groovy

    r322 r323  
    7070    }
    7171
     72    /**
     73    * Toggle the visibility of an html element and update an image.
     74    * @param toggleId The html id of the element to toggle.
     75    * @param imageid The html id of the image to update.
     76    * @param openImgUrl The url to apply as the image src when toggled element is visible.
     77    * @param closedImgUrl The url to apply as the image src when toggled element is hidden.
     78    * @param type The type of html action the javascript will be applied to e.g 'onclick', defaults to 'href'.
     79    * @returns A javascript string that can be assigned for example to an anchor href or onclick action.
     80    */
     81    def toggleWithImgAndEffect(toggleId, imageid, openImgUrl, closedImgUrl, type="href") {
     82
     83        def s = 'toggleWithImgAndEffectUtil(\"' + toggleId +'\", \"' + imageid +'\", \"' + openImgUrl +'\", \"' + closedImgUrl +'\");'
     84        if(type == "onclick")
     85            s + ' return false;'
     86        else
     87            'javascript: ' + s
     88
     89    }
     90
    7291} // end class
Note: See TracChangeset for help on using the changeset viewer.