mirror of
https://github.com/jasny/bootstrap.git
synced 2026-04-24 03:00:49 -04:00
Support iOS device
1. iOS device does not fire click event if A without href. 2. iOS device does not fire click event if Element cursor is not pointer.
This commit is contained in:
@@ -33,8 +33,10 @@
|
||||
$(window).on('resize', $.proxy(this.recalc, this))
|
||||
}
|
||||
|
||||
if (this.options.autohide && !this.options.modal)
|
||||
$(document).on('click', $.proxy(this.autohide, this))
|
||||
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))
|
||||
}
|
||||
|
||||
if (this.options.toggle) this.toggle()
|
||||
|
||||
@@ -358,12 +360,12 @@
|
||||
$(document).on('click.bs.offcanvas.data-api', '[data-toggle=offcanvas]', function (e) {
|
||||
var $this = $(this), href
|
||||
var target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
var $canvas = $(target)
|
||||
var data = $canvas.data('bs.offcanvas')
|
||||
var option = data ? 'toggle' : $this.data()
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation()
|
||||
|
||||
if (data) data.toggle()
|
||||
|
||||
Reference in New Issue
Block a user