Permalink
Browse files

fix(nav-dropdown): Fix right alignment in <b-nav> (#962)

* fix(nav-dropdown): Fix right alignment in <b-nav>

* chore(docs): document jumbotron slots in meta.json

* chore(docs): fix formatting in jumbotron meta.json

* Update nav-item-dropdown.vue

* Update dropdown.js
  • Loading branch information...
tmorehouse committed Aug 31, 2017
1 parent 785b7a6 commit 95987631e3edca90879021aebc8d01d706a3944f
Showing with 9 additions and 5 deletions.
  1. +1 −1 lib/components/nav-item-dropdown.vue
  2. +8 −4 lib/mixins/dropdown.js
@@ -3,7 +3,7 @@
<a :class="toggleClasses"
href="#"
ref="button"
ref="toggle"
:id="safeId('_BV_button_')"
aria-haspopup="true"
:aria-expanded="visible ? 'true' : 'false'"
@@ -99,10 +99,12 @@ export default {
};
// To keep one dropdown opened on page
this.listenOnRoot("shown::dropdown", listener);
this.listenOnRoot("bv::dropdown::shown", listener);
// Hide when clicked on links
this.listenOnRoot("clicked::link", listener);
// Use new namespaced events
this.listenOnRoot("bv::link::clicked", listener);
},
watch: {
visible(state, old) {
@@ -118,7 +120,9 @@ export default {
}
},
computed: {
toggler: () => this.$refs.toggle.$el || this.$refs.toggle
toggler() {
return this.$refs.toggle.$el || this.$refs.toggle;
}
},
destroyed() {
if (this._popper) {
@@ -136,7 +140,7 @@ export default {
// TODO: move emit show to visible watcher, to allow cancelling of show
this.$emit("show");
// Ensure other menus are closed
this.emitOnRoot("shown::dropdown", this);
this.emitOnRoot("bv::dropdown::shown", this);
// If popper not installed, then fallback gracefully to dropdown only with left alignment
if (typeof Popper === "function") {
@@ -145,7 +149,7 @@ export default {
this.inNavbar = Boolean(this.$el.closest(".navbar"));
}
// for dropup with alignment we use the parent element as popper container
let element = (this.dropup && this.right) || this.split || this.inNavbar ? this.$el : this.$refs.toggle;
let element = ((this.dropup && this.right) || this.split || this.inNavbar) ? this.$el : this.$refs.toggle;
// Make sure we have a reference to an element, not a component!
element = element.$el || element;

0 comments on commit 9598763

Please sign in to comment.