Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Solved issue #14
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideTriso committed Feb 9, 2018
1 parent fc0e37a commit 8ed791b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 77 deletions.
26 changes: 1 addition & 25 deletions dist/aria-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
firstFocussableElement = focussableElements.first(),
lastFocussableElement = focussableElements.last();

self.elementWithFocus = $(':focus'); //the element with focus just before the dialog is opened
self.elementWithFocus = $(':focus'); //get the element with focus just before the dialog is opened


/*
Expand Down Expand Up @@ -284,23 +284,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
event.stopPropagation();
});
}
//close dialog when escape is pressed
if (settings.closeWithEsc) {
win.on('keydown.' + pluginName, function (event) {
if (event.keyCode === 27 && checkForModifierKeys(event) === 'none') {
self.updateHash('hide');
}
});
}
//close dialog if user clicks on bg
if (settings.closeOnBgClick) {
element.on('click.' + pluginName, function () {
self.updateHash('hide');
});
dialogWindow.on('click.' + pluginName, function (event) {
event.stopPropagation();
});
}

//Update dialog state
self.elementState = true;
Expand Down Expand Up @@ -354,13 +337,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
//trigger custom event on window for authors to listen for
win.trigger(pluginName + '.hide', [self]);
},
updateHash: function (action) {
if (action === 'show') {
document.location.hash = this.elementId;
} else {
document.location.hash = '';
}
},
methodCaller: function (methodName) {
var self = this;
/*
Expand Down
2 changes: 1 addition & 1 deletion dist/aria-dialog.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 1 addition & 25 deletions docs/aria-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
firstFocussableElement = focussableElements.first(),
lastFocussableElement = focussableElements.last();

self.elementWithFocus = $(':focus'); //the element with focus just before the dialog is opened
self.elementWithFocus = $(':focus'); //get the element with focus just before the dialog is opened


/*
Expand Down Expand Up @@ -284,23 +284,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
event.stopPropagation();
});
}
//close dialog when escape is pressed
if (settings.closeWithEsc) {
win.on('keydown.' + pluginName, function (event) {
if (event.keyCode === 27 && checkForModifierKeys(event) === 'none') {
self.updateHash('hide');
}
});
}
//close dialog if user clicks on bg
if (settings.closeOnBgClick) {
element.on('click.' + pluginName, function () {
self.updateHash('hide');
});
dialogWindow.on('click.' + pluginName, function (event) {
event.stopPropagation();
});
}

//Update dialog state
self.elementState = true;
Expand Down Expand Up @@ -354,13 +337,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
//trigger custom event on window for authors to listen for
win.trigger(pluginName + '.hide', [self]);
},
updateHash: function (action) {
if (action === 'show') {
document.location.hash = this.elementId;
} else {
document.location.hash = '';
}
},
methodCaller: function (methodName) {
var self = this;
/*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "t-aria-dialog",
"version": "2.0.2",
"version": "2.0.3",
"description": "HTML, CSS and JS UI-component for user-friendly and accessible dialogs",
"license": "MIT",
"repository": {
Expand Down
26 changes: 1 addition & 25 deletions src/js/aria-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
firstFocussableElement = focussableElements.first(),
lastFocussableElement = focussableElements.last();

self.elementWithFocus = $(':focus'); //the element with focus just before the dialog is opened
self.elementWithFocus = $(':focus'); //get the element with focus just before the dialog is opened


/*
Expand Down Expand Up @@ -284,23 +284,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
event.stopPropagation();
});
}
//close dialog when escape is pressed
if (settings.closeWithEsc) {
win.on('keydown.' + pluginName, function (event) {
if (event.keyCode === 27 && checkForModifierKeys(event) === 'none') {
self.updateHash('hide');
}
});
}
//close dialog if user clicks on bg
if (settings.closeOnBgClick) {
element.on('click.' + pluginName, function () {
self.updateHash('hide');
});
dialogWindow.on('click.' + pluginName, function (event) {
event.stopPropagation();
});
}

//Update dialog state
self.elementState = true;
Expand Down Expand Up @@ -354,13 +337,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
//trigger custom event on window for authors to listen for
win.trigger(pluginName + '.hide', [self]);
},
updateHash: function (action) {
if (action === 'show') {
document.location.hash = this.elementId;
} else {
document.location.hash = '';
}
},
methodCaller: function (methodName) {
var self = this;
/*
Expand Down

0 comments on commit 8ed791b

Please sign in to comment.