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:
commit
cef3175dbd
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue