Skip to content

Commit

Permalink
Add container full locked class on main container
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Feb 14, 2019
1 parent d06c783 commit 15002cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/navbar-fixed-full-locked-fluid.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</ul>
</div>

<div class="container-main container-fixed-top container-force-open-left">
<div class="container-main container-fixed-top container-full-locked container-force-open-left">
<!-- NAVBAR -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
Expand Down
7 changes: 7 additions & 0 deletions js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default class Sidebar extends BasePlugin
this.$obfuscator = $('<div class="' + this.options.classObfuscator + '"></div>');
this.$body = $('body');
this.enabled = !this.$element.hasClass('sidebar-disabled');
this.fullLocked = this.$element.hasClass(this.options.classFullLocked);
this.hammer = null;
this.dragStartPosition = null;
this.mouseDragEnd = null;
Expand Down Expand Up @@ -148,6 +149,10 @@ export default class Sidebar extends BasePlugin
}
}

if (this.fullLocked) {
this.$container.addClass('container-full-locked');
}

isOver = isOverMinWidth(this);

$(window).on('keyup.fxp.sidebar' + this.guid, null, this, keyboardAction);
Expand Down Expand Up @@ -491,6 +496,7 @@ export default class Sidebar extends BasePlugin
cleanCloseDelay(this);
this.detachToggles();
this.forceClose();
this.$container.removeClass('container-full-locked');
$(window).off('keyup.fxp.sidebar' + this.guid, keyboardAction);
$(window).off('resize.fxp.sidebar' + this.guid, onResizeWindow);
this.$element.off(this.eventType + '.fxp.sidebar' + this.guid, this.options.itemSelector, closeOnSelect);
Expand Down Expand Up @@ -520,6 +526,7 @@ Sidebar.defaultOptions = {
classContainer: 'container-main',
classOpen: 'sidebar-open',
classLocked: 'sidebar-locked',
classFullLocked: 'sidebar-full-locked',
classForceOpen: 'sidebar-force-open',
classOnDragging: 'sidebar-dragging',
classObfuscator: 'sidebar-obfuscator',
Expand Down

0 comments on commit 15002cb

Please sign in to comment.