diff --git a/components/com_contact/views/categories/tmpl/default.php b/components/com_contact/views/categories/tmpl/default.php index 8b1f767ae1f2a..863c26cb77b77 100644 --- a/components/com_contact/views/categories/tmpl/default.php +++ b/components/com_contact/views/categories/tmpl/default.php @@ -11,6 +11,11 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); +JHtml::_('behavior.core'); + +// Add strings for translations in Javascript. +JText::script('JGLOBAL_EXPAND_CATEGORIES '); +JText::script('JGLOBAL_COLLAPSE_CATEGORIES'); JFactory::getDocument()->addScriptDeclaration(" jQuery(function($) { @@ -19,6 +24,12 @@ btn.on('click', function() { btn.find('span').toggleClass('icon-plus'); btn.find('span').toggleClass('icon-minus'); + if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')) + { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES')); + } else { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')); + } }); }); });"); diff --git a/components/com_contact/views/categories/tmpl/default_items.php b/components/com_contact/views/categories/tmpl/default_items.php index 3b47f2b8c535b..fc8cd3aff2edd 100644 --- a/components/com_contact/views/categories/tmpl/default_items.php +++ b/components/com_contact/views/categories/tmpl/default_items.php @@ -35,7 +35,7 @@ maxLevelcat > 1 && count($item->getChildren()) > 0) : ?> + data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right" aria-label=""> params->get('show_subcat_desc_cat') == 1) : ?> diff --git a/components/com_content/views/categories/tmpl/default.php b/components/com_content/views/categories/tmpl/default.php index 772afa6cb13a2..ce1830b5b7aaf 100644 --- a/components/com_content/views/categories/tmpl/default.php +++ b/components/com_content/views/categories/tmpl/default.php @@ -11,6 +11,11 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); +JHtml::_('behavior.core'); + +// Add strings for translations in Javascript. +JText::script('JGLOBAL_EXPAND_CATEGORIES '); +JText::script('JGLOBAL_COLLAPSE_CATEGORIES'); JFactory::getDocument()->addScriptDeclaration(" jQuery(function($) { @@ -19,6 +24,12 @@ btn.on('click', function() { btn.find('span').toggleClass('icon-plus'); btn.find('span').toggleClass('icon-minus'); + if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')) + { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES')); + } else { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')); + } }); }); });"); diff --git a/components/com_content/views/categories/tmpl/default_items.php b/components/com_content/views/categories/tmpl/default_items.php index 62e83113fbb6f..55f655fed9a2c 100644 --- a/components/com_content/views/categories/tmpl/default_items.php +++ b/components/com_content/views/categories/tmpl/default_items.php @@ -37,7 +37,7 @@ getChildren()) > 0 && $this->maxLevelcat > 1) : ?> + data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right" aria-label=""> params->get('show_description_image') && $item->getParams()->get('image')) : ?> diff --git a/components/com_content/views/category/tmpl/blog_children.php b/components/com_content/views/category/tmpl/blog_children.php index 645704e9a7746..0a39500d95747 100644 --- a/components/com_content/views/category/tmpl/blog_children.php +++ b/components/com_content/views/category/tmpl/blog_children.php @@ -39,7 +39,7 @@ escape($child->title); ?> maxLevel > 1 && count($child->getChildren()) > 0) : ?> - + @@ -53,7 +53,7 @@ maxLevel > 1 && count($child->getChildren()) > 0) : ?> - + diff --git a/components/com_content/views/category/tmpl/default_children.php b/components/com_content/views/category/tmpl/default_children.php index 6f36899dc9d9f..68805bd323108 100644 --- a/components/com_content/views/category/tmpl/default_children.php +++ b/components/com_content/views/category/tmpl/default_children.php @@ -42,7 +42,7 @@ escape($child->title); ?> getChildren()) > 0 && $this->maxLevel > 1) : ?> - + @@ -55,7 +55,7 @@ getChildren()) > 0 && $this->maxLevel > 1) : ?> - + diff --git a/components/com_newsfeeds/views/categories/tmpl/default.php b/components/com_newsfeeds/views/categories/tmpl/default.php index 0f6c60003c28a..6570e8061ce87 100644 --- a/components/com_newsfeeds/views/categories/tmpl/default.php +++ b/components/com_newsfeeds/views/categories/tmpl/default.php @@ -11,6 +11,11 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); +JHtml::_('behavior.core'); + +// Add strings for translations in Javascript. +JText::script('JGLOBAL_EXPAND_CATEGORIES '); +JText::script('JGLOBAL_COLLAPSE_CATEGORIES'); JFactory::getDocument()->addScriptDeclaration(" jQuery(function($) { @@ -19,6 +24,12 @@ btn.on('click', function() { btn.find('span').toggleClass('icon-plus'); btn.find('span').toggleClass('icon-minus'); + if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')) + { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES')); + } else { + btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES ')); + } }); }); });"); diff --git a/components/com_newsfeeds/views/categories/tmpl/default_items.php b/components/com_newsfeeds/views/categories/tmpl/default_items.php index 7166c1449ecfd..95c3bbb91989a 100644 --- a/components/com_newsfeeds/views/categories/tmpl/default_items.php +++ b/components/com_newsfeeds/views/categories/tmpl/default_items.php @@ -33,8 +33,8 @@ getChildren()) > 0 && $this->maxLevelcat > 1) : ?> - + data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right" aria-label=""> + diff --git a/language/en-GB/en-GB.ini b/language/en-GB/en-GB.ini index f6b33e44713be..12018c8eff42f 100644 --- a/language/en-GB/en-GB.ini +++ b/language/en-GB/en-GB.ini @@ -191,6 +191,7 @@ JGLOBAL_CATEGORY_NOT_FOUND="Category not found" JGLOBAL_CENTER="Center" JGLOBAL_CHECK_ALL="Check All Items" JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" +JGLOBAL_COLLAPSE_CATEGORIES="Show less categories" JGLOBAL_CREATED_DATE_ON="Created on %s" JGLOBAL_CUSTOM_CATEGORY="New Categories" JGLOBAL_DESCRIPTION="Description" @@ -199,6 +200,7 @@ JGLOBAL_EDIT="Edit" JGLOBAL_EDIT_TITLE="Edit article" JGLOBAL_EMAIL="Email" JGLOBAL_EMAIL_TITLE="Email this link to a friend" +JGLOBAL_EXPAND_CATEGORIES ="Show more categories" JGLOBAL_FIELD_ADD="Add" JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC="Categories that are within this category will be displayed." JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL="Select a Top Level Category"