Skip to content

Commit

Permalink
fix(dropdowns): Minor code update & comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorehouse authored Aug 31, 2017
1 parent 2777380 commit 54a2546
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mixins/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ export default {
hideMenu() {
// TODO: move emit hide to visible watcher, to allow cancelling of hide
this.$emit("hide");
this.emitOnRoot("hidden::dropdown", this);
if (this._popper) {
if (this._popper) {
// Ensure popper event listeners are removed cleanly
this._popper.destroy();
}
this._popper = null;
this.setTouchStart(false);
this.$emit("hidden");
this.emitOnRoot("bv::dropdown::hidden", this);
this.$emit("hidden");
},
getPopperConfig() {
let placement = AttachmentMap.BOTTOM;
Expand Down Expand Up @@ -230,6 +230,7 @@ export default {
this.visible = false;
},
click(e) {
// Calle only in split button mode, for the split button
if (this.disabled) {
this.visible = false;
return;
Expand All @@ -238,6 +239,7 @@ export default {
this.$emit("click", e);
},
toggle() {
// Called only by a button that toggles teh menu
if (this.disabled) {
this.visible = false;
return;
Expand Down

0 comments on commit 54a2546

Please sign in to comment.