move dialog

TNL-6047
This commit is contained in:
muhammad-ammar
2017-01-04 11:02:18 +05:00
committed by Mushtaq Ali
parent 52f8c9763a
commit 1b011af7e2
20 changed files with 290 additions and 112 deletions

View File

@@ -78,16 +78,17 @@
return this;
},
inFocus: function() {
inFocus: function(wrapperElementSelector) {
var wrapper = wrapperElementSelector || '.wrapper',
tabbables;
this.options.outFocusElement = this.options.outFocusElement || document.activeElement;
// Set focus to the container.
this.$('.wrapper').first().focus();
this.$(wrapper).first().focus();
// Make tabs within the prompt loop rather than setting focus
// back to the main content of the page.
var tabbables = this.$(tabbable_elements.join());
tabbables = this.$(tabbable_elements.join());
tabbables.on('keydown', function(event) {
// On tab backward from the first tabbable item in the prompt
if (event.which === 9 && event.shiftKey && event.target === tabbables.first()[0]) {