ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_load_anim.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
25 function with_load_anim()
26 {
27  global $DIC;
28  $f = $DIC->ui()->factory();
29  $renderer = $DIC->ui()->renderer();
30 
31  return $renderer->render(
32  //Create a button with the LoadingAnimation on click and some additional JS-Magic.
33  $f->button()->standard("Do Something", "")
34  ->withLoadingAnimationOnClick(true)
35  ->withOnLoadCode(function ($id) {
36  return " $('#$id').click(
37  function(e) {
38  $('#$id').html('Working...');
39  setInterval(
40  function(){
41  $('#$id').html('Done');
42  il.UI.button.deactivateLoadingAnimation('$id');
43  }
44  ,3000
45  );
46  });";
47  })
48  );
49 }
$renderer
with_load_anim()
description: > In this example we create a button that ships with the on load animation on click...
global $DIC
Definition: shib_login.php:25
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24