Skip to content

Commit

Permalink
fixed bug where callback is not executed
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalKleindienst committed Oct 23, 2016
1 parent b240dfb commit 623a4ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/saga-gallery.min.js

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

9 changes: 5 additions & 4 deletions src/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import { bindEvents } from './Events';
* Set open / close state of gallery
*/
const setState = (open, gallery) => {
let cb;
if (open) {
let cb = 'onOpen';
cb = 'onOpen';
gallery.el.classList.add('saga-slider-active');
} else {
let cb = 'onClose';
cb = 'onClose';
gallery.el.classList.remove('saga-slider-active');
}

if (typeof gallery.options[type] === 'function') {
return gallery.options[type].call(gallery);
if (typeof gallery.options[cb] === 'function') {
return gallery.options[cb].call(gallery);
}
};

Expand Down

0 comments on commit 623a4ab

Please sign in to comment.