diff --git a/administrator/components/com_contact/src/Table/ContactTable.php b/administrator/components/com_contact/src/Table/ContactTable.php index 85c248abbd28c..95f74cabab5b4 100644 --- a/administrator/components/com_contact/src/Table/ContactTable.php +++ b/administrator/components/com_contact/src/Table/ContactTable.php @@ -119,8 +119,13 @@ public function store($updateNulls = true) $table = Table::getInstance('ContactTable', __NAMESPACE__ . '\\', array('dbo' => $this->getDbo())); if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) { + // Is the existing contact trashed? $this->setError(Text::_('COM_CONTACT_ERROR_UNIQUE_ALIAS')); + if ($table->published === -2) { + $this->setError(Text::_('COM_CONTACT_ERROR_UNIQUE_ALIAS_TRASHED')); + } + return false; } diff --git a/administrator/components/com_finder/src/Table/FilterTable.php b/administrator/components/com_finder/src/Table/FilterTable.php index 621076fa65ccb..932fb30caf88a 100644 --- a/administrator/components/com_finder/src/Table/FilterTable.php +++ b/administrator/components/com_finder/src/Table/FilterTable.php @@ -157,7 +157,7 @@ public function store($updateNulls = true) $table = new static($this->getDbo()); if ($table->load(array('alias' => $this->alias)) && ($table->filter_id != $this->filter_id || $this->filter_id == 0)) { - $this->setError(Text::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS')); + $this->setError(Text::_('COM_FINDER_FILTER_ERROR_UNIQUE_ALIAS')); return false; } diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue index f22bb8daa2662..0694262cab894 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue @@ -17,107 +17,129 @@ @on-focused="focused" @keyup.up="openLastActions()" @keyup.down="openActions()" + @keyup.end="openLastActions()" + @keyup.home="openActions()" + @keydown.up.prevent + @keydown.down.prevent + @keydown.home.prevent + @keydown.end.prevent /> @@ -170,6 +192,7 @@ export default { /* Hide actions dropdown */ hideActions() { this.showActions = false; + this.$parent.$parent.$data.actionsActive = false; }, /* Preview an item */ openPreview() { @@ -200,19 +223,89 @@ export default { /* Open actions dropdown */ openActions() { this.showActions = true; + this.$parent.$parent.$data.actionsActive = true; const buttons = [...this.$el.parentElement.querySelectorAll('.media-browser-actions-list button')]; if (buttons.length) { + buttons.forEach((button, i) => { + if (i === (0)) { + button.tabIndex = 0; + } else { + button.tabIndex = -1; + } + }); buttons[0].focus(); } }, /* Open actions dropdown and focus on last element */ openLastActions() { this.showActions = true; + this.$parent.$parent.$data.actionsActive = true; const buttons = [...this.$el.parentElement.querySelectorAll('.media-browser-actions-list button')]; if (buttons.length) { + buttons.forEach((button, i) => { + if (i === (buttons.length)) { + button.tabIndex = 0; + } else { + button.tabIndex = -1; + } + }); this.$nextTick(() => buttons[buttons.length - 1].focus()); } }, + /* Focus on the next item or go to the beginning again */ + focusNext(event) { + const active = event.target; + const buttons = [...active.parentElement.querySelectorAll('button')]; + const lastchild = buttons[buttons.length - 1]; + active.tabIndex = -1; + if (active === lastchild) { + buttons[0].focus(); + buttons[0].tabIndex = 0; + } else { + active.nextElementSibling.focus(); + active.nextElementSibling.tabIndex = 0; + } + }, + /* Focus on the previous item or go to the end again */ + focusPrev(event) { + const active = event.target; + const buttons = [...active.parentElement.querySelectorAll('button')]; + const firstchild = buttons[0]; + active.tabIndex = -1; + if (active === firstchild) { + buttons[buttons.length - 1].focus(); + buttons[buttons.length - 1].tabIndex = 0; + } else { + active.previousElementSibling.focus(); + active.previousElementSibling.tabIndex = 0; + } + }, + /* Focus on the first item */ + focusFirst(event) { + const active = event.target; + const buttons = [...active.parentElement.querySelectorAll('button')]; + buttons[0].focus(); + buttons.forEach((button, i) => { + if (i === 0) { + button.tabIndex = 0; + } else { + button.tabIndex = -1; + } + }); + }, + /* Focus on the last item */ + focusLast(event) { + const active = event.target; + const buttons = [...active.parentElement.querySelectorAll('button')]; + buttons[buttons.length - 1].focus(); + buttons.forEach((button, i) => { + if (i === (buttons.length)) { + button.tabIndex = 0; + } else { + button.tabIndex = -1; + } + }); + }, editItem() { this.edit(); }, diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/delete.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/delete.vue index 70008116b1b82..ceb05b83e2daa 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/delete.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/delete.vue @@ -2,19 +2,20 @@ diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/download.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/download.vue index 914964d1d57f4..dc973f93333f3 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/download.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/download.vue @@ -2,10 +2,9 @@ diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/edit.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/edit.vue index ca796ea12c5e2..0c82cf4bf0b68 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/edit.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/edit.vue @@ -2,10 +2,9 @@ diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/preview.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/preview.vue index db29e51b300ff..e74f3ec84590c 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/preview.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/preview.vue @@ -2,8 +2,7 @@ diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/rename.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/rename.vue index b2ef7221c889f..bf89a55886c53 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/rename.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/rename.vue @@ -3,8 +3,7 @@ ref="actionRenameButton" type="button" class="action-rename" - :aria-label="translate('COM_MEDIA_ACTION_RENAME')" - :title="translate('COM_MEDIA_ACTION_RENAME')" + @click.stop="openRenameModal()" @keyup.enter="openRenameModal()" @keyup.space="openRenameModal()" @focus="focused(true)" @@ -12,10 +11,12 @@ @keyup.esc="hideActions()" >