Skip to content

Commit

Permalink
Handle undefined body style in OffCanvas.disableScrolling(). Fixes #214
Browse files Browse the repository at this point in the history
  • Loading branch information
jasny committed May 6, 2014
1 parent 2712c97 commit a088dad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@
var bodyWidth = $('body').width()
var prop = 'padding-' + this.opposite(this.placement)

if ($('body').data('offcanvas-style') === undefined) $('body').data('offcanvas-style', $('body').attr('style'))

if ($('body').data('offcanvas-style') === undefined) {
$('body').data('offcanvas-style', $('body').attr('style') || '')
}

$('body').css('overflow', 'hidden')

if ($('body').width() > bodyWidth) {
Expand Down

0 comments on commit a088dad

Please sign in to comment.