ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
with_load_anim.php
Go to the documentation of this file.
1 <?php
9 function with_load_anim()
10 {
11  global $DIC;
12  $f = $DIC->ui()->factory();
13  $renderer = $DIC->ui()->renderer();
14 
15  return $renderer->render(
16  //Create a button with the LoadingAnimation on click and some additional JS-Magic.
17  $f->button()->standard("Do Something", "")
18  ->withLoadingAnimationOnClick(true)
19  ->withOnLoadCode(function ($id) {
20  return
21  "$('#$id').click(function(e) {
22  $('#$id').html('Working...');
23  setInterval(
24  function(){
25  $('#$id').html('Done');
26  il.UI.button.deactivateLoadingAnimation('$id');
27  }
28  ,3000);
29  });";
30  })
31  );
32 }
with_load_anim()
global $DIC
Definition: goto.php:24