mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-09 04:28:38 -05:00
Fix an accessibility issue to maximize the panel for all alertify dialog. Fixes #5143
This commit is contained in:
committed by
Akshay Joshi
parent
0ed3cd248b
commit
82155cd859
@@ -8,8 +8,8 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
define([
|
||||
'sources/gettext', 'alertify', 'jquery',
|
||||
], function(gettext, alertify, $) {
|
||||
'sources/gettext', 'alertify', 'jquery', 'sources/utils',
|
||||
], function(gettext, alertify, $, commonUtils) {
|
||||
alertify.defaults.transition = 'zoom';
|
||||
alertify.defaults.theme.ok = 'btn btn-primary fa fa-lg fa-check pg-alertify-button';
|
||||
alertify.defaults.theme.cancel = 'btn btn-secondary fa fa-lg fa-times pg-alertify-button';
|
||||
@@ -263,7 +263,15 @@ define([
|
||||
$(this.elements.commands.close).attr('aria-label', gettext('Close'));
|
||||
$(this.elements.commands.maximize).attr('aria-label', gettext('Maximize'));
|
||||
alertifyDialogResized.apply(this, arguments);
|
||||
});
|
||||
let self = this;
|
||||
|
||||
let cmds = Object.values(this.elements.commands);
|
||||
$(cmds).on('keydown', 'button', (event) => {
|
||||
if (event.shiftKey && event.keyCode == 9 && $(this).nextAll('button:not([disabled])').length == 0){
|
||||
let container = $(self.elements.footer);
|
||||
commonUtils.findAndSetFocus(container.find('button:not([disabled]):last'));
|
||||
}
|
||||
}); });
|
||||
this.set('onresize', alertifyDialogStartResizing.bind(this, true));
|
||||
this.set('onresized', alertifyDialogResized.bind(this, true));
|
||||
this.set('onmaximized', alertifyDialogResized);
|
||||
@@ -279,6 +287,15 @@ define([
|
||||
this.__internal.buttons[i]['key'] = null;
|
||||
}
|
||||
}
|
||||
let self = this;
|
||||
|
||||
$(this.elements.footer).on('keydown', 'button', function(event) {
|
||||
if (!event.shiftKey && event.keyCode == 9 && $(this).nextAll('button:not([disabled])').length == 0) {
|
||||
// set focus back to first editable input element of current active tab once we cycle through all enabled buttons.
|
||||
commonUtils.findAndSetFocus($(self.elements.dialog));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
alertify.pgHandleItemError = function(xhr, error, message, args) {
|
||||
|
||||
@@ -60,14 +60,6 @@ export class DialogWrapper {
|
||||
this.pgBrowser.keyboardNavigation.getDialogTabNavigator($(alertifyDialog.elements.dialog));
|
||||
const container = backform_tab.find('.tab-content:first > .tab-pane.active:first');
|
||||
commonUtils.findAndSetFocus(container);
|
||||
|
||||
$(alertifyDialog.elements.footer).on('keydown', 'button', function(event) {
|
||||
if (event.keyCode == 9 && $(this).nextAll('button:not([disabled])').length == 0) {
|
||||
// set focus back to first editable input element of current active tab once we cycle through all enabled buttons.
|
||||
commonUtils.findAndSetFocus($(alertifyDialog.elements.dialog));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
isNodeSelected(selectedTreeNode) {
|
||||
|
||||
Reference in New Issue
Block a user