open-nomad/ui/app/helpers/css-class.js

16 lines
352 B
JavaScript
Raw Normal View History

import { helper } from '@ember/component/helper';
2017-09-19 14:47:10 +00:00
/**
* CSS Class
*
* Usage: {{css-class updateType}}
*
* Outputs a css friendly class string from any human string.
* Differs from dasherize by handling slashes.
*/
export function cssClass([updateType]) {
return updateType.replace(/\//g, '-').dasherize();
}
export default helper(cssClass);