mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-03-16 22:10:27 +00:00
[rating-bar] changes on comments
This commit is contained in:
parent
9b2f9c5683
commit
820a0394f7
1 changed files with 3 additions and 2 deletions
|
|
@ -78,12 +78,13 @@
|
|||
this.$emit('change', selected / this.mdNumStars);
|
||||
}
|
||||
},
|
||||
getIconIndex(iconSelected) {//icon is a dom element
|
||||
getIconIndex(iconSelected) {//iconSelected is a dom element
|
||||
let ratingIcons = this.$el.querySelectorAll('.md-back-stars > .md-icon, .md-front-stars > .md-icon');
|
||||
let selected = -1;
|
||||
|
||||
ratingIcons = Array.prototype.slice.call(ratingIcons);
|
||||
ratingIcons.some((icon, i) => {//find index
|
||||
//find index from iconSelected
|
||||
ratingIcons.some((icon, i) => {
|
||||
if (icon === iconSelected) {
|
||||
selected = (i + 1) % this.mdNumStars;
|
||||
selected = !selected ? this.mdNumStars : selected;
|
||||
|
|
|
|||
Loading…
Reference in a new issue