Skip to content

Commit

Permalink
Safari bug fix - Update to self.lastFocus where safari wasn't support…
Browse files Browse the repository at this point in the history
…ing document.activeElement
  • Loading branch information
danhumaan committed Jul 5, 2018
1 parent 7331e5c commit 004a14e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

***

- Version 0.4.1
- Version 0.4.2
- Requires jQuery 1.11.2 or higher (v2 not tested, v3 works but not extensively stress tested).
- Built by [Humaan](http://www.humaan.com)

Expand Down
2 changes: 1 addition & 1 deletion dist/css/modaal.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/modaal.min.css

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

2 changes: 1 addition & 1 deletion dist/css/modaal.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down
9 changes: 3 additions & 6 deletions dist/js/modaal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down Expand Up @@ -111,7 +111,7 @@
};

self.lastFocus = null;

// if is_locked
if ( self.options.is_locked || self.options.type == 'confirm' || self.options.hide_close ) {
self.scope.close_btn = '';
Expand Down Expand Up @@ -153,7 +153,7 @@
var source;

// Save last active state before modal
self.lastFocus = document.activeElement;
self.lastFocus = self.$elem;

if ( self.options.should_open === false || ( typeof self.options.should_open === 'function' && self.options.should_open() === false ) ) {
return;
Expand Down Expand Up @@ -670,9 +670,6 @@
} else {
// This is only a single gallery item so let's grab the necessary values

// Setup selected image
console.log(self.scope);

var this_img_src = self.$elem.attr('data-modaal-content-source') ? self.$elem.attr('data-modaal-content-source') : 'trigger requires data-modaal-content-source attribute';
var this_img_alt_txt = '';
var this_img_alt = '';
Expand Down
4 changes: 2 additions & 2 deletions dist/js/modaal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h1><svg class="modaal-logo" viewBox="0 0 108.256 32.294">
<p>An accessible dialog window plugin for all humans.</p>
<a href="https://github.com/humaan/Modaal" target="_blank" class="btn btn-download">Download from Github</a>
<a href="#inline-content" class="btn modaal main-example" data-modaal-type="inline">View Example</a>
<div class="version" aria-label="Version 0.4.1">v0.4.1</div>
<div class="version" aria-label="Version 0.4.2">v0.4.2</div>
<a href="http://www.humaan.com" target="_blank" class="humaan-project">A Humaan project</a>

<div class="share">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modaal",
"description": "An accessible dialog window library for all humans.",
"version": "0.4.1",
"version": "0.4.2",
"repository": "https://github.com/humaan/Modaal",
"license": "MIT",
"main": "dist/js/modaal.js",
Expand Down
2 changes: 1 addition & 1 deletion source/css/modaal.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down
2 changes: 1 addition & 1 deletion source/css/modaal.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down
9 changes: 3 additions & 6 deletions source/js/modaal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Modaal - accessible modals - v0.4.1
Modaal - accessible modals - v0.4.2
by Humaan, for all humans.
http://humaan.com
*/
Expand Down Expand Up @@ -111,7 +111,7 @@
};

self.lastFocus = null;

// if is_locked
if ( self.options.is_locked || self.options.type == 'confirm' || self.options.hide_close ) {
self.scope.close_btn = '';
Expand Down Expand Up @@ -153,7 +153,7 @@
var source;

// Save last active state before modal
self.lastFocus = document.activeElement;
self.lastFocus = self.$elem;

if ( self.options.should_open === false || ( typeof self.options.should_open === 'function' && self.options.should_open() === false ) ) {
return;
Expand Down Expand Up @@ -670,9 +670,6 @@
} else {
// This is only a single gallery item so let's grab the necessary values

// Setup selected image
console.log(self.scope);

var this_img_src = self.$elem.attr('data-modaal-content-source') ? self.$elem.attr('data-modaal-content-source') : 'trigger requires data-modaal-content-source attribute';
var this_img_alt_txt = '';
var this_img_alt = '';
Expand Down

0 comments on commit 004a14e

Please sign in to comment.