Guest User

Untitled

a guest
Jun 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <div class="menuButton" onclick="${remoteFunction(action: 'index', controller: 'file', update: [success: 'ajax', failure: 'ajax'])}">
  2. <label class="menu">File upload</label>
  3. </div>
  4.  
  5. <script type="text/javascript">
  6. function showSpinner() {
  7. // TODO show spinner
  8. }
  9. function hideSpinner() {
  10. // TODO hide spinner
  11. }
  12. Ajax.Responders.register({
  13. onLoading: function() {
  14. showSpinner();
  15. },
  16. onComplete: function() {
  17. if(!Ajax.activeRequestCount) hideSpinner();
  18. }
  19. });
  20. </script>
  21.  
  22. <script type="text/javascript">
  23. function showSpinner() {
  24. $('spinner').show();
  25. }
  26. function hideSpinner() {
  27. $('spinner').hide();
  28. }
  29. Ajax.Responders.register({
  30. onLoading: function() {
  31. showSpinner();
  32. },
  33. onComplete: function() {
  34. if(!Ajax.activeRequestCount) hideSpinner();
  35. }
  36. });
  37. </script>
  38. <div id="spinner" style="display: none;">
  39. <img src="${createLinkTo(dir:'images',file:'spinner.gif')}" alt="Loading..." width="16" height="16" />
  40. </div>
Add Comment
Please, Sign In to add comment