Skip to content

Commit

Permalink
fix(navbar): breakpoint not working
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorehouse committed Aug 16, 2017
1 parent 825093f commit 42ca902
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/components/navbar.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export const props = {
type: String type: String
}, },
toggleable: { toggleable: {
type: Boolean, type: [Boolean, String],
default: false default: false
}, },
toggleBreakpoint: { toggleBreakpoint: {
// Deprecated: to be removed soon
type: String, type: String,
default: null default: null
}, },
Expand All @@ -33,11 +34,10 @@ export default {
functional: true, functional: true,
props, props,
render(h, { props, data, children }) { render(h, { props, data, children }) {
let toggleClass = "navbar-toggleable"; let breakpoint = this.toggleBreakpoint || 'sm';
if (props.toggleBreakpoint) { if (typeof this.toggleable === 'string') {
toggleClass += `-${props.toggleBreakpoint}`; breakpoint = this.toggleable;
} }

return h( return h(
props.tag, props.tag,
mergeData(data, { mergeData(data, {
Expand All @@ -47,7 +47,7 @@ export default {
[`bg-${props.variant}`]: Boolean(props.variant), [`bg-${props.variant}`]: Boolean(props.variant),
[`fixed-${props.fixed}`]: Boolean(props.fixed), [`fixed-${props.fixed}`]: Boolean(props.fixed),
"sticky-top": props.sticky, "sticky-top": props.sticky,
[toggleClass]: props.toggleable [`navbar-expand-${breakpoint}`]: Boolean(props.toggleable)
} }
}), }),
children children
Expand Down

0 comments on commit 42ca902

Please sign in to comment.