mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
add aria attributes + restructure some js to change the aria attributes
This commit is contained in:
parent
dd919b7f80
commit
0542cd6a14
5 changed files with 83 additions and 70 deletions
|
@ -208,11 +208,8 @@ $(document).ready(function(){
|
|||
|
||||
// Dropdown menus with the class "dropdown-head" will display the active tab
|
||||
// as button text
|
||||
$("body").on('click', '.dropdown-head .dropdown-menu li a', function(){
|
||||
$(this).closest(".dropdown").find('.btn').html($(this).text() + ' <span class="caret"></span>');
|
||||
$(this).closest(".dropdown").find('.btn').val($(this).data('value'));
|
||||
$(this).closest("ul").children("li").show();
|
||||
$(this).parent("li").hide();
|
||||
$("body").on('click', '.dropdown-head .dropdown-menu li a, .dropdown-head .dropdown-menu li button', function(){
|
||||
toggleDropdownText(this);
|
||||
});
|
||||
|
||||
/* setup onoff widgets */
|
||||
|
@ -688,3 +685,17 @@ function bin2hex (s) {
|
|||
|
||||
return o;
|
||||
}
|
||||
|
||||
// Dropdown menus with the class "dropdown-head" will display the active tab
|
||||
// as button text
|
||||
function toggleDropdownText(elm) {
|
||||
$(elm).closest(".dropdown").find('.btn').html($(elm).text() + ' <span class="caret"></span>');
|
||||
$(elm).closest(".dropdown").find('.btn').val($(elm).data('value'));
|
||||
$(elm).closest("ul").children("li").show();
|
||||
$(elm).parent("li").hide();
|
||||
}
|
||||
|
||||
// Check if element does have a specific class
|
||||
function hasClass(elem, cls) {
|
||||
return (" " + elem.className + " " ).indexOf( " "+cls+" " ) > -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue