Merge pull request #450 from fstiehle/patch-1

Performance Improvement var $this = $(this);
This commit is contained in:
Arnold Daniels
2016-06-08 19:48:55 +02:00

View File

@@ -189,11 +189,12 @@
}
elements.addClass('canvas-sliding').each(function() {
if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '')
if ($(this).css('position') === 'static') $(this).css('position', 'relative')
if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') &&
($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) {
$(this).css(placement, 0)
var $this = $(this)
if ($this.data('offcanvas-style') === undefined) $this.data('offcanvas-style', $this.attr('style') || '')
if ($this.css('position') === 'static') $this.css('position', 'relative')
if (($this.css(placement) === 'auto' || $this.css(placement) === '0px') &&
($this.css(opposite) === 'auto' || $this.css(opposite) === '0px')) {
$this.css(placement, 0)
}
})