Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Commit

Permalink
Changed order of conditionals to check if attr is a callback first.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase Peeler committed Oct 25, 2017
1 parent 5e4f415 commit 64cfa74
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ var Lightbox = (function ($) {
}, {
key: '_getAttr',
value: function _getAttr(element, attr) {
if (0 === attr.indexOf("data-")) {
return $(element).data(attr.replace("data-", ""));
} else if (typeof attr === 'function') {
if (typeof attr === 'function') {
return attr.call(element);
} else if (0 === attr.toString().indexOf("data-")) {
return $(element).data(attr.replace("data-", ""));
} else {
return $(element).attr(attr);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/ekko-lightbox.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ekko-lightbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ekko-lightbox.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ const Lightbox = (($) => {
}

_getAttr(element,attr){
if(0 === attr.indexOf("data-")){
return $(element).data(attr.replace("data-",""));
} else if(typeof attr === 'function') {
if(typeof attr === 'function') {
return attr.call(element);
} else if(0 === attr.toString().indexOf("data-")) {
return $(element).data(attr.replace("data-", ""));
} else {
return $(element).attr(attr);
}
Expand Down

0 comments on commit 64cfa74

Please sign in to comment.