mirror of
https://github.com/jasny/bootstrap.git
synced 2026-04-24 03:00:49 -04:00
Make disable scrolling optional for offcanvas. Fixes #193
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user