Changeset 323 for trunk/grails-app/services
- Timestamp:
 - Feb 8, 2010, 3:23:01 AM (16 years ago)
 - File:
 - 
          
- 1 edited
 
- 
          trunk/grails-app/services/JsUtilService.groovy (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
        
trunk/grails-app/services/JsUtilService.groovy
r322 r323 70 70 } 71 71 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 72 91 } // end class  
Note: See TracChangeset
          for help on using the changeset viewer.
      