0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #1046 from buddhamagnet/cache-selector-in-after-render

Cache selector in afterRender function
This commit is contained in:
Hannah Wolfe 2013-10-14 13:47:23 -07:00
commit cef3175dbd

View file

@ -408,14 +408,16 @@
afterRender: function () {
var self = this;
Countable.live(document.getElementById('user-bio'), function (counter) {
var bioContainer = self.$('.bio-container .word-count');
if (counter.all > 180) {
self.$('.bio-container .word-count').css({color: "#e25440"});
bioContainer.css({color: "#e25440"});
} else {
self.$('.bio-container .word-count').css({color: "#9E9D95"});
bioContainer.css({color: "#9E9D95"});
}
self.$('.bio-container .word-count').text(200 - counter.all);
bioContainer.text(200 - counter.all);
});