fixes issues #309

Full credit to @Akkuzin for the fix.
This commit is contained in:
Mike Zielonka
2015-08-20 00:02:18 -05:00
parent 2dc9cb4917
commit e9505f2909

View File

@@ -35,7 +35,7 @@
if (this.options.autohide && !this.options.modal) {
var eventName = (navigator.userAgent.match(/(iPad|iPhone)/i) === null) ? 'click' : 'touchstart'
$(document).on(eventName, $.proxy(this.autohide, this))
$(document).on('click touchstart', $.proxy(this.autohide, this))
}
if (this.options.toggle) this.toggle()
@@ -324,6 +324,8 @@
OffCanvas.prototype.autohide = function (e) {
if ($(e.target).closest(this.$element).length === 0) this.hide()
var target = $(e.target);
if (!target.hasClass('dropdown-backdrop') && $(e.target).closest(this.$element).length === 0) this.hide()
}
// OFFCANVAS PLUGIN DEFINITION