Skip to content

Commit

Permalink
Merge pull request #405 from mikezielonka/master
Browse files Browse the repository at this point in the history
fixes issues #309
  • Loading branch information
jasny committed Dec 5, 2015
2 parents 4e27c63 + e9505f2 commit ade9f48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ade9f48

Please sign in to comment.