}
}
- $(document).on('keydown.' + this._eventNamespace, $.proxy(this._keyDown, this));
+ this._bindListener();
this._isOpen = true;
this._timer.stop();
}
- $(document).off('keydown.' + this._eventNamespace);
+ this._unbindListener();
this._isOpen = false;
return true;
},
+ /**
+ * Binds event listeners.
+ */
+ _bindListener: function() {
+ $(document).on('keydown.' + this._eventNamespace, $.proxy(this._keyDown, this));
+ $(window).on('resize.' + this._eventNamespace, $.proxy(this._renderImage, this));
+ },
+
+ /**
+ * Unbinds event listeners.
+ */
+ _unbindListener: function() {
+ $(document).off('keydown.' + this._eventNamespace);
+ $(window).off('resize.' + this._eventNamespace);
+ },
+
/**
* Closes the slideshow on escape.
*