Last change
on this file since 754 was
322,
checked in by gav, 15 years ago
|
Move JavascriptService to JsUtilService.
Consolidate similar JsUtilService methods.
Create JsUtilTagLib?.
Disable pulsing of asset tree loading image.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[312] | 1 | |
---|
| 2 | function showAssetTreePane(paneDivId, loadingImg, url) { |
---|
[316] | 3 | |
---|
[312] | 4 | Effect.Appear(paneDivId,{duration:0.4}); |
---|
[316] | 5 | |
---|
[322] | 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 }); |
---|
[316] | 9 | |
---|
[312] | 10 | new Ajax.Updater({ success: paneDivId }, url, {asynchronous:true,evalScripts:true}); |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | function hideAssetTreePane(paneDivId, tableDivId, saveUrl) { |
---|
| 14 | |
---|
[316] | 15 | // Collect the visible branch div's first. |
---|
[312] | 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 | |
---|
[316] | 31 | // Post the id's of all visible branch div's. |
---|
[312] | 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.