Make disable scrolling optional for offcanvas. Fixes #193

This commit is contained in:
Arnold Daniels
2014-03-25 14:34:59 +01:00
parent 6849bc40f3
commit 8586cec904
2 changed files with 9 additions and 2 deletions

View File

@@ -180,6 +180,12 @@ $('.navmenu').offcanvas()
<td>true</td>
<td>Calculate if off canvas should be disabled for this viewport width on window resize. If your elements always gets hidden on window resize, try setting this to false.</td>
</tr>
<tr>
<td>disableScrolling</td>
<td>boolean</td>
<td>true</td>
<td>Disable scrolling when the off canvas element is shown, by setting overflow to hidden for the body.</td>
</tr>
</tbody>
</table>

View File

@@ -44,7 +44,8 @@
toggle: true,
placement: 'left',
autohide: true,
recalc: true
recalc: true,
disableScrolling: true
}
OffCanvas.prototype.offset = function () {
@@ -170,7 +171,7 @@
if (elements.index(this.$element) !== -1) this.$element.css(placement, -1 * offset)
this.disableScrolling()
if (this.options.disableScrolling) this.disableScrolling()
var complete = function () {
this.state = 'slid'