| author | ymh <ymh.work@gmail.com> |
| Tue, 15 Nov 2016 18:27:17 +0100 | |
| changeset 426 | d8ae6c0c0a0a |
| parent 176 | d1baf7ccecc8 |
| child 468 | 8fe093d88efe |
| permissions | -rw-r--r-- |
import Ember from 'ember'; export function popularity([target, minimum, maximum]) { var classname = ['not-popular', 'popular', 'very-popular']; var interval = ( maximum - minimum ) / classname.length; var i = 0; while( target > minimum + ( interval * ( i + 1 ) ) ) { i ++; } return classname[i]; } export default Ember.Helper.helper(popularity);