MDL-74802 core: Improve the accessibility of alert notifications
* Make the ordering of the message and the close button logical on the DOM. * Hide the times HTML entity * Add sr-only label on the close button for non-sighted users * Add tooltip on the close button sighted users
This commit is contained in:
@@ -39,6 +39,12 @@
|
||||
<div class="alert alert-danger alert-block fade in {{ extraclasses }}" {{!
|
||||
}}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}{{!
|
||||
}}>
|
||||
{{# closebutton }}<button type="button" class="close" data-dismiss="alert">×</button>{{/ closebutton }}
|
||||
{{{ message }}}
|
||||
{{# closebutton }}{{!
|
||||
}}<button type="button" class="close" data-dismiss="alert"{{!
|
||||
}} title="{{#str}}dismissnotification, core{{/str}}" data-toggle="tooltip">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">{{#str}}dismissnotification, core{{/str}}</span>
|
||||
</button>{{!
|
||||
}}{{/ closebutton }}
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,12 @@
|
||||
<div class="alert alert-info alert-block fade in {{ extraclasses }}" {{!
|
||||
}}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}{{!
|
||||
}}>
|
||||
{{# closebutton }}<button type="button" class="close" data-dismiss="alert">×</button>{{/ closebutton }}
|
||||
{{{ message }}}
|
||||
{{# closebutton }}{{!
|
||||
}}<button type="button" class="close" data-dismiss="alert"{{!
|
||||
}} title="{{#str}}dismissnotification, core{{/str}}" data-toggle="tooltip">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">{{#str}}dismissnotification, core{{/str}}</span>
|
||||
</button>{{!
|
||||
}}{{/ closebutton }}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
<div class="alert alert-success alert-block fade in {{ extraclasses }}" {{!
|
||||
}}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}{{!
|
||||
}}>
|
||||
{{# closebutton }}<button type="button" class="close" data-dismiss="alert">×</button>{{/ closebutton }}
|
||||
{{{ message }}}
|
||||
{{# closebutton }}{{!
|
||||
}}<button type="button" class="close" data-dismiss="alert"{{!
|
||||
}} title="{{#str}}dismissnotification, core{{/str}}" data-toggle="tooltip">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">{{#str}}dismissnotification, core{{/str}}</span>
|
||||
</button>{{!
|
||||
}}{{/ closebutton }}
|
||||
</div>
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
<div class="alert alert-warning alert-block fade in {{ extraclasses }}" {{!
|
||||
}}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}{{!
|
||||
}}>
|
||||
{{# closebutton }}<button type="button" class="close" data-dismiss="alert">×</button>{{/ closebutton }}
|
||||
{{{ message }}}
|
||||
{{# closebutton }}{{!
|
||||
}}<button type="button" class="close" data-dismiss="alert"{{!
|
||||
}} title="{{#str}}dismissnotification, core{{/str}}" data-toggle="tooltip">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">{{#str}}dismissnotification, core{{/str}}</span>
|
||||
</button>{{!
|
||||
}}{{/ closebutton }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user