Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
    Moodle is free software: you can redistribute it and/or modify
4
    it under the terms of the GNU General Public License as published by
5
    the Free Software Foundation, either version 3 of the License, or
6
    (at your option) any later version.
7
    Moodle is distributed in the hope that it will be useful,
8
    but WITHOUT ANY WARRANTY; without even the implied warranty of
9
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
    GNU General Public License for more details.
11
    You should have received a copy of the GNU General Public License
12
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
13
}}
14
{{!
15
    @template core/local/action_menu/subpanel
16
    Action menu link.
17
    Example context (json):
18
    {
19
        "id": "exampleId12345678",
20
        "text": "Example link text",
21
        "subpanelcontent": "Example subpanel content",
22
        "url": "http://example.com",
23
        "attributes": [
24
            {
25
                "name": "data-attribute",
26
                "value": "example"
27
            }
28
        ],
29
        "itemicon": {
30
            "key": "t/groups",
31
            "component": "core",
32
            "title": "Example icon title"
33
        },
34
        "instance": 1,
35
        "disabled": false
36
    }
37
}}
38
<div
39
    class="dropdown-subpanel position-relative dropright"
40
    id="{{id}}"
41
>
42
    <a
43
        class="dropdown-item dropdown-toggle {{#disabled}} disabled {{/disabled}}"
44
        href="{{url}}"
45
        data-toggle="dropdown-subpanel"
46
        role="menuitem"
47
        aria-haspopup="true"
48
        tabindex="-1"
49
        aria-expanded="false"
50
        aria-label="{{text}}"
51
        {{#attributes}}
52
            {{name}}="{{value}}"
53
        {{/attributes}}
54
    >
55
        {{#itemicon}}
56
            {{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}
57
        {{/itemicon}}
58
        <span class="menu-action-text" id="actionmenuactionsubpanel-{{instance}}">{{{text}}}</span>
59
    </a>
60
    <div class="dropdown-menu dropdown-subpanel-content" role="menu">
61
        {{{subpanelcontent}}}
62
    </div>
63
</div>
64
{{#js}}
65
    require(['core/local/action_menu/subpanel'], function(Module) {
66
        Module.init('#' + '{{id}}');
67
    });
68
{{/js}}