diff options
Diffstat (limited to 'addons/web/static/src/js/widgets/priority.js')
| -rw-r--r-- | addons/web/static/src/js/widgets/priority.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/web/static/src/js/widgets/priority.js b/addons/web/static/src/js/widgets/priority.js index fbe7b61bb43..44ff3b50c1e 100644 --- a/addons/web/static/src/js/widgets/priority.js +++ b/addons/web/static/src/js/widgets/priority.js @@ -66,13 +66,15 @@ var Priority = Widget.extend({ this._render_value(); }, _render_value: function() { - var current_value = this.value; + var self = this; + var index_value = this.value ? _.findIndex(this.values, function (v) { + return v[0] === self.value; + }) : 0; this.$stars = this.$('.o_priority_star'); this.$stars.each(function(i, el) { var $star = $(el); - var star_value = $star.data('value'); - $star.toggleClass('fa-star', (star_value <= current_value)) - .toggleClass('fa-star-o', (star_value > current_value)); + $star.toggleClass('fa-star', (i+1 <= index_value)) + .toggleClass('fa-star-o', (i+1 > index_value)); }); }, }); |
