Support tab navigation in dialogs. Fixes #2898

This commit is contained in:
Harshal Dhumal
2018-02-27 11:18:36 +00:00
committed by Dave Page
parent 3be22383b8
commit aa1849c13a
15 changed files with 485 additions and 92 deletions

View File

@@ -2,9 +2,10 @@
define('tools.restore', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
'underscore.string', 'pgadmin.alertifyjs', 'pgadmin.browser',
'pgadmin.backgrid', 'pgadmin.backform',
'pgadmin.backgrid', 'pgadmin.backform', 'sources/utils',
], function(
gettext, url_for, $, _, Backbone, S, alertify, pgBrowser, Backgrid, Backform
gettext, url_for, $, _, Backbone, S, alertify, pgBrowser, Backgrid, Backform,
commonUtils
) {
// if module is already initialized, refer to that.
@@ -572,6 +573,12 @@ define('tools.restore', [
this.elements.content.appendChild($container.get(0));
view.$el.attr('tabindex', -1);
// var dialogTabNavigator = pgBrowser.keyboardNavigation.getDialogTabNavigator(view);
pgBrowser.keyboardNavigation.getDialogTabNavigator(view);
var container = view.$el.find('.tab-content:first > .tab-pane.active:first');
commonUtils.findAndSetFocus(container);
// Listen to model & if filename is provided then enable Backup button
this.view.model.on('change', function() {
if (!_.isUndefined(this.get('file')) && this.get('file') !== '') {