Skip to content

Commit

Permalink
Changed beforeShow & beforeHide back to $.noop and added an explicit …
Browse files Browse the repository at this point in the history
…comparison to FALSE.
  • Loading branch information
leoquijano committed Mar 18, 2016
1 parent 979cf19 commit e474793
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/easyzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
preventClicks: true,

// Callback function to execute before the flyout is displayed.
beforeShow: null,
beforeShow: $.noop,

// Callback function to execute before the flyout is removed.
beforeHide: null,
beforeHide: $.noop,

// Callback function to execute when the flyout is displayed.
onShow: $.noop,
Expand Down Expand Up @@ -79,7 +79,7 @@
var w1, h1, w2, h2;
var self = this;

if (this.opts.beforeShow && !this.opts.beforeShow.call(this)) return;
if (this.opts.beforeShow.call(this) === false) return;

if (!this.isReady) {
return this._loadImage(this.$link.attr('href'), function() {
Expand Down Expand Up @@ -246,7 +246,7 @@
*/
EasyZoom.prototype.hide = function() {
if (!this.isOpen) return;
if (this.opts.beforeHide && !this.opts.beforeHide.call(this)) return;
if (this.opts.beforeHide.call(this) === false) return;

this.$flyout.detach();
this.isOpen = false;
Expand Down

0 comments on commit e474793

Please sign in to comment.