ILIAS  release_8 Revision v8.23
with_load_anim.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
14 function with_load_anim()
15 {
16  global $DIC;
17  $f = $DIC->ui()->factory();
18  $renderer = $DIC->ui()->renderer();
19 
20  return $renderer->render(
21  //Create a button with the LoadingAnimation on click and some additional JS-Magic.
22  $f->button()->standard("Do Something", "")
23  ->withLoadingAnimationOnClick(true)
24  ->withOnLoadCode(function ($id) {
25  return
26  "$('#$id').click(function(e) {
27  $('#$id').html('Working...');
28  setInterval(
29  function(){
30  $('#$id').html('Done');
31  il.UI.button.deactivateLoadingAnimation('$id');
32  }
33  ,3000);
34  });";
35  })
36  );
37 }
with_load_anim()
In this example we create a button that ships with the on load animation on click.
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23