Ghost/core/client/helpers/gh-count-down-characters.js
Fabian Becker ef3fa3b9dc Validate and properly color letter count.
fixes #4087
- Adds correct validations for meta_title/meta_description
- Adds correct coloring of letter count
2014-09-22 12:55:03 +00:00

17 lines
473 B
JavaScript

var countDownCharacters = Ember.Handlebars.makeBoundHelper(function (content, maxCharacters) {
var el = document.createElement('span'),
length = content ? content.length : 0;
el.className = 'word-count';
if (length > maxCharacters) {
el.style.color = '#E25440';
} else {
el.style.color = '#9FBB58';
}
el.innerHTML = length;
return new Ember.Handlebars.SafeString(el.outerHTML);
});
export default countDownCharacters;