diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php
index 99b2a5a24436b..58d0409deb2c6 100644
--- a/administrator/components/com_content/tmpl/articles/default.php
+++ b/administrator/components/com_content/tmpl/articles/default.php
@@ -71,6 +71,27 @@
});
});
})();
+
+// This script should be moved to searchtools.js
+(function() {
+ document.addEventListener('DOMContentLoaded', function() {
+ var sort = document.getElementById('sorted');
+ // hasAttribute() evaluates if an element has a specific attribute defined
+ if(sort.hasAttribute('data-caption')) {
+ // getAttribute() returns the value of a given attribute
+ var caption = sort.getAttribute('data-caption');
+ document.getElementById("captionUpdated").textContent += caption;
+ };
+ });
+})();
+
+// This script needs to bee converted to es6 fromm jquery
+jQuery(function ($) {
+ $('th').attr('aria-sort', function () {
+ return $(this).find('a').data('sort')
+ })
+});
+
JS;
// @todo move the script to a file
@@ -101,6 +122,10 @@
diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index 3c30e21d89f8d..19bec3485b94f 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -6,6 +6,7 @@ COM_CONTENT="Articles" COM_CONTENT_ADD_NEW_MENU_ITEM="New Menu Item" +COM_CONTENT_ARTICLES_CAPTION="Table of articles" COM_CONTENT_ARTICLE_CONTENT="Content" COM_CONTENT_ARTICLES_TITLE="Articles" COM_CONTENT_ARTICLE_CONTENT="Content" diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index e6288bbeb4be9..92e5409923ca1 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -591,6 +591,7 @@ JGLOBAL_SHOW_VOTE_DESC="If set to show, a voting system will be enabled for Arti JGLOBAL_SHOW_VOTE_LABEL="Voting" JGLOBAL_SINGLE_LEVEL="Single Level" JGLOBAL_SORT_BY="Sort Table By:" +JGLOBAL_SORTED_BY="Sorted by:" JGLOBAL_START_PUBLISH_AFTER_FINISH="Item start publishing date must be before finish publishing date" JGLOBAL_SUBHEADING_DESC="Optional text to show as a subheading." JGLOBAL_SUBHEADING_LABEL="Page Subheading" diff --git a/administrator/templates/atum/scss/blocks/_searchtools.scss b/administrator/templates/atum/scss/blocks/_searchtools.scss index b3fb0809391d8..ac6a3a9b5b376 100644 --- a/administrator/templates/atum/scss/blocks/_searchtools.scss +++ b/administrator/templates/atum/scss/blocks/_searchtools.scss @@ -71,3 +71,9 @@ } } } + +.js-stools-button-sort { + cursor: pointer; + background: none; + border: 0; +} diff --git a/layouts/joomla/searchtools/grid/sort.php b/layouts/joomla/searchtools/grid/sort.php index a83524974630b..d4cc86923e4da 100644 --- a/layouts/joomla/searchtools/grid/sort.php +++ b/layouts/joomla/searchtools/grid/sort.php @@ -13,20 +13,36 @@ use Joomla\CMS\Language\Text; $data = $displayData; +$icon = "icon-menu-2"; +$sort = "none"; +$caption = ''; +$selected = ''; +$id = ''; -$title = htmlspecialchars(Text::_($data->tip ?: $data->title)); -HTMLHelper::_('bootstrap.popover'); +if ($data->order === $data->selected) : + $icon = $data->orderIcon; + $sort = $data->direction === 'asc' ? 'ascending' : 'descending'; + $caption = !empty($data->title) ? Text::_($data->title) . ' - ' . $sort : ''; + $selected = ' selected'; + $id = 'id="sorted"'; +endif; ?> - -icon)) : ?> - - title)) : ?> - title); ?> - -order === $data->selected) : ?> - + + title); ?> + - + \ No newline at end of file |
---|