|
Last change
on this file since 650 was
322,
checked in by gav, 16 years ago
|
|
Move JavascriptService to JsUtilService.
Consolidate similar JsUtilService methods.
Create JsUtilTagLib?.
Disable pulsing of asset tree loading image.
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | |
|---|
| 2 | function showAssetTreePane(paneDivId, loadingImg, url) { |
|---|
| 3 | |
|---|
| 4 | Effect.Appear(paneDivId,{duration:0.4}); |
|---|
| 5 | |
|---|
| 6 | // Disabled since pulsing effect blocks other javascript till complete. |
|---|
| 7 | // The effect may be stopped with e.cancel() but we will use the default Grails spinner for now. |
|---|
| 8 | // def e = new Effect.Pulsate($(loadingImg), { pulses: 200, duration: 133 }); |
|---|
| 9 | |
|---|
| 10 | new Ajax.Updater({ success: paneDivId }, url, {asynchronous:true,evalScripts:true}); |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | function hideAssetTreePane(paneDivId, tableDivId, saveUrl) { |
|---|
| 14 | |
|---|
| 15 | // Collect the visible branch div's first. |
|---|
| 16 | var visibleDivs = $(tableDivId).select('div').findAll(function(el) { return el.visible(); }) |
|---|
| 17 | var params = "assetTreeVisibleBranches="; |
|---|
| 18 | |
|---|
| 19 | // Hide the pane. |
|---|
| 20 | $(paneDivId).toggle(); |
|---|
| 21 | |
|---|
| 22 | // Add the id of each visible div to params. |
|---|
| 23 | visibleDivs.each(function(it) { |
|---|
| 24 | params += it.identify(); |
|---|
| 25 | params += "," |
|---|
| 26 | }); |
|---|
| 27 | |
|---|
| 28 | // Remove the trailing comma. |
|---|
| 29 | params = params.slice(0,params.length-1); |
|---|
| 30 | |
|---|
| 31 | // Post the id's of all visible branch div's. |
|---|
| 32 | // asynchronous: false is against the prototype recommendations but appears to be needed in this case. |
|---|
| 33 | new Ajax.Request(saveUrl, {parameters: params, asynchronous: false}); |
|---|
| 34 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.