Skip to content

Commit

Permalink
v3.2.1
Browse files Browse the repository at this point in the history
  - Fixed a visual bug when adding several messages at once (see issue #16)
  • Loading branch information
Aymkdn committed Apr 18, 2021
1 parent 71069c9 commit cbe057e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "v-snackbars",
"version": "3.2.0",
"version": "3.2.1",
"description": "Display the v-snackbar (from Vuetify) with a stack display",
"main": "v-snackbars.vue",
"scripts": {
Expand Down
42 changes: 20 additions & 22 deletions v-snackbars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,6 @@ export default {
this.eventify(this.objects);
},
deep: true
},
snackbars() {
// retrieve the height for each snackbar
this.$nextTick(function() {
let ret = {};
this.snackbars.forEach((o, idx) => {
let height = this.distance;
let elem = document.querySelector(".v-snackbars-" + this.identifier + "-" + o.key);
if (elem) {
let wrapper = elem.querySelector(".v-snack__wrapper");
if (wrapper) {
height = wrapper.clientHeight + 7;
}
}
ret[o.key] = height;
});
this.heights = ret;
});
}
},
methods: {
Expand Down Expand Up @@ -180,10 +162,26 @@ export default {
this.keys.push(key);
this.$nextTick(function() {
this.snackbars[i].show=true; // to see the come-in animation
let timeout = this.getProp("timeout", i);
if (timeout > 0) {
setTimeout(() => this.removeMessage(key, true), timeout * 1);
}
this.$nextTick(function () {
// find the correct height
let height = this.distance;
let elem = document.querySelector(".v-snackbars-" + this.identifier + "-" + key);
if (elem) {
let wrapper = elem.querySelector(".v-snack__wrapper");
if (wrapper) {
height = wrapper.clientHeight + 7;
}
}
this.$set(this.heights, key, height);
// define the timeout
let timeout = this.getProp("timeout", i);
if (timeout > 0) {
setTimeout(() => this.removeMessage(key, true), timeout * 1);
}
});
})
}
},
Expand Down

0 comments on commit cbe057e

Please sign in to comment.