mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-20 17:54:23 +01:00
avoid unnecessary HTML string building+parsing
This commit is contained in:
parent
253dfc0d3d
commit
a14665e73e
@ -34,7 +34,10 @@
|
|||||||
if (!isActive) {
|
if (!isActive) {
|
||||||
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||||
// if mobile we use a backdrop because click events don't delegate
|
// if mobile we use a backdrop because click events don't delegate
|
||||||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
$(document.createElement('div'))
|
||||||
|
.addClass('dropdown-backdrop')
|
||||||
|
.insertAfter($(this))
|
||||||
|
.on('click', clearMenus)
|
||||||
}
|
}
|
||||||
|
|
||||||
var relatedTarget = { relatedTarget: this }
|
var relatedTarget = { relatedTarget: this }
|
||||||
|
@ -190,7 +190,8 @@
|
|||||||
if (this.isShown && this.options.backdrop) {
|
if (this.isShown && this.options.backdrop) {
|
||||||
var doAnimate = $.support.transition && animate
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
this.$backdrop = $(document.createElement('div'))
|
||||||
|
.addClass('modal-backdrop ' + animate)
|
||||||
.appendTo(this.$body)
|
.appendTo(this.$body)
|
||||||
|
|
||||||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user