Commit b88b2cee authored by Liam Sharpe's avatar Liam Sharpe Committed by Robert Lyon

Made edit, delete, and add buttons more consistant on menus page - Bug #1543343

Also added the screenreader only text to the edit/delete/add buttons

behatnotneeded

Change-Id: Ie463d015d309152ba3d72ca3768d9b6606d1396b
parent 5a488a7a
......@@ -72,9 +72,9 @@ function formatrow (item) {
// item has id, type, name, link, linkedto
var type = eval(item.type);
var linkedto = A({'href':item.linkedto},item.linktext);
var edit = BUTTON({'type':'button','class':'button btn btn-default btn-sm'}, SPAN({'class':'icon icon-lg icon-pencil left', 'role':'presentation'}), {$getstring['edit']});
var edit = BUTTON({'type':'button','class':'button btn btn-default btn-sm','title':{$getstring['edit']}}, SPAN({'class':'icon icon-lg icon-pencil', 'role':'presentation'}), SPAN({'class':'sr-only'}, {$getstring['edit']}));
connect(edit, 'onclick', function () { edititem(item); });
var del = BUTTON({'type':'button','class':'button btn btn-default btn-sm'}, SPAN({'class':'icon icon-lg icon-times text-danger left', 'role':'presentation'}), {$getstring['delete']});
var del = BUTTON({'type':'button','class':'button btn btn-default btn-sm','title': {$getstring['delete']}}, SPAN({'class':'icon icon-lg icon-trash text-danger', 'role':'presentation'}), SPAN({'class':'sr-only'}, {$getstring['delete']}));
connect(del, 'onclick', function () { delitem(item.id); });
var buttonGroup = SPAN({'class':'btn-group'}, edit, del);
var cells = map(
......@@ -106,7 +106,7 @@ function editform(item) {
// Either a save, a cancel button, or both.
var savecancel = [];
var save = BUTTON({'type':'button','class':'button btn btn-default btn-sm'}, SPAN({'class':'icon icon-plus-circle icon-lg', 'role':'presentation'}));
var save = BUTTON({'type':'button','class':'button btn btn-default btn-sm','title': {$getstring['update']}}, SPAN({'class':'icon icon-plus icon-lg', 'role':'presentation'}), SPAN({'class':'sr-only'}, {$getstring['update']}));
connect(save, 'onclick', function () { saveitem(item.id); });
// The link field will be a text box or a select in the case of an admin file.
......@@ -125,6 +125,9 @@ function editform(item) {
connect(afile, 'onclick', function () { changeaddform('sitefile'); });
// The save button says 'add', and there's no cancel button.
setNodeAttribute(save,'value',{$getstring['add']});
setNodeAttribute(save,'title',{$getstring['add']});
var savesr = getFirstElementByTagAndClassName('span', 'sr-only', save);
savesr.innerHTML = {$getstring['add']};
savecancel = [save];
}
else { // Editing an existing menu item.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment