Skip to content

Commit ade9f48

Browse files
committed
Merge pull request #405 from mikezielonka/master
fixes issues #309
2 parents 4e27c63 + e9505f2 commit ade9f48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/offcanvas.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
if (this.options.autohide && !this.options.modal) {
3737
var eventName = (navigator.userAgent.match(/(iPad|iPhone)/i) === null) ? 'click' : 'touchstart'
38-
$(document).on(eventName, $.proxy(this.autohide, this))
38+
$(document).on('click touchstart', $.proxy(this.autohide, this))
3939
}
4040

4141
if (this.options.toggle) this.toggle()
@@ -324,6 +324,8 @@
324324

325325
OffCanvas.prototype.autohide = function (e) {
326326
if ($(e.target).closest(this.$element).length === 0) this.hide()
327+
var target = $(e.target);
328+
if (!target.hasClass('dropdown-backdrop') && $(e.target).closest(this.$element).length === 0) this.hide()
327329
}
328330

329331
// OFFCANVAS PLUGIN DEFINITION

0 commit comments

Comments
 (0)