Merge branch 'MDL-81713-main' of https://github.com/junpataleta/moodle
[moodle.git] / lib / templates / sticky_footer.mustache
blob8a71afd38ae5d7537672c100b06abf94afdc36f3
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
17 {{!
18     @template core/sticky_footer
20     Displays a page sticky footer element.
22     Sticky footer behaviour depends on the theme. The default template is
23     a regular element.
25     Classes required for JS:
26     * none
28     Data attributes optional for JS:
29     * data-disable Number|String - If the sticky footer should be disabled by default
31     Context variables required for this template:
32     * disable Boolean - if the sticky footer should be loaded hidden
34     Example context (json):
35     {
36         "stickycontent" : "<a href=\"#\">Moodle</a>",
37         "extras" : [
38             {
39                 "attribute" : "data-example",
40                 "value" : "stickyfooter"
41             }
42         ],
43         "stickyclasses" : "extraclasses"
44     }
46 <div
47     id="sticky-footer"
48     class="{{$ stickyclasses }}{{stickyclasses}}{{/ stickyclasses }}"
49     {{$ disable }}
50         {{#disable}} data-disable="true" {{/disable}}
51     {{/ disable }}
52     {{#extras}}
53     {{attribute}}="{{value}}"
54     {{/extras}}
56     {{$ stickycontent }}
57         {{{stickycontent}}}
58     {{/ stickycontent }}
59 </div>
60 {{#js}}
61 require(['core/sticky-footer'], function(footer) {
62     footer.init();
63 });
65 {{/js}}