Permalink
Browse files

Merge branch 'MDL-60527_32-action-menu-links-missing-spaces-attribute…

…s' of https://github.com/lucaboesch/moodle into MOODLE_32_STABLE
  • Loading branch information...
dmonllao committed Oct 23, 2017
2 parents fde7473 + 1712134 commit 0b3e013f64f9473be0f573e12aac536dbb410ed5
@@ -29,7 +29,7 @@
}
}}
{{^disabled}}
<a href="{{url}}" class="{{classes}}"{{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}} {{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
<a href="{{url}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
{{/disabled}}
{{#disabled}}
<span class="currentlink" role="menuitem">{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</span>
@@ -27,7 +27,7 @@
}
}}
{{^disabled}}
<a href="{{url}}" class="{{classes}}"{{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}} {{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
<a href="{{url}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
{{/disabled}}
{{#disabled}}
<span class="currentlink" role="menuitem">{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</span>
@@ -15,14 +15,86 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core/action_menu_trigger
Action menu trigger.
Example context (json):
{
"text": "Example link text",
"title": "Example link title",
"url": "http://example.com/link",
"classes": "icon menu-action",
"instance": "1",
"attributes": [
{"name": "role", "value": "menuitem" },
{"name": "data-title", "value": "mymoodle,admin" },
{"name": "alt", "value": "Example img alt" },
{"name": "src", "value": "http://localhost/stable_master/theme/image.php?theme=boost&component=core&image=dashboard" }
],
"secondary": {
"classes": "menu align-tr-br",
"attributes": [
{"name": "id", "value": "action-menu-0-menu"},
{"name": "data-rel", "value": "menu-content"},
{"name": "role", "value": "menu"},
{"name": "data-align", "value": "tr-br"}
],
"items": [
{"actionmenulink":
{
"id": "action_link59ecf8394a68078",
"disabled": false,
"text": "Dashboard",
"url": "http://example.com/link",
"icon": {
"attributes": [
{
"name": "alt",
"value": "Dashboard"
},
{
"name": "title",
"value": "Dashboard"
},
{
"name": "src",
"value": "http://localhost/stable_master/theme/image.php?theme=boost&component=core&image=dashboard"
}
]
},
"classes": "icon menu-action",
"attributes": [
{"name": "role", "value": "menuitem"},
{"name": "data-title", "value": "mymoodle,admin"}
],
"instance": 1,
"showtext": true
}
},
{"actionmenufiller":
{
"id": "action_link59ecf8394a68079",
"disabled": false,
"text": "",
"url": "",
"icon": null,
"classes": "",
"attributes": [
{"name": "role", "value": "menuitem"}
]
}
}
]
}
}
}}
<div class="dropdown d-inline">
<a href="#" class="dropdown-toggle" id="action-menu-toggle-{{instance}}" title="{{title}}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{{actiontext}}}{{{menutrigger}}}{{#icon}}{{> core/pix_icon}}{{/icon}}{{#rawicon}}{{{.}}}{{/rawicon}}{{#menutrigger}}<b class="caret"></b>{{/menutrigger}}</a>
{{#secondary}}
<div class="dropdown-menu dropdown-menu-right {{classes}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
{{#items}}{{!
}}{{#actionmenulink}}<a href="{{url}}" class="dropdown-item {{classes}}"{{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}} {{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>{{/actionmenulink}}{{!
}}{{#actionmenulink}}<a href="{{url}}" class="dropdown-item {{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>{{/actionmenulink}}{{!
}}{{#actionmenufiller}}<div class="dropdown-divider"></div>{{/actionmenufiller}}{{!
}}{{^actionmenulink}}{{^actionmenufiller}}<div class="dropdown-item">{{> core/action_menu_item }}</div>{{/actionmenufiller}}{{/actionmenulink}}{{!
}}{{/items}}

0 comments on commit 0b3e013

Please sign in to comment.