From 74c474a652d32294394ef7b329d1bcddb64cc2e0 Mon Sep 17 00:00:00 2001
From: Sebastian Morr <sebastian@morr.cc>
Date: Fri, 21 Apr 2017 18:17:21 +0200
Subject: Display remaining characters when editing display name and bio
 (#2219)

---
 app/assets/javascripts/extras.jsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'app/assets/javascripts/extras.jsx')

diff --git a/app/assets/javascripts/extras.jsx b/app/assets/javascripts/extras.jsx
index c13feceff..29c37b9e1 100644
--- a/app/assets/javascripts/extras.jsx
+++ b/app/assets/javascripts/extras.jsx
@@ -37,4 +37,12 @@ $(() => {
       $(e.target).parent().attr('style', null);
     }
   });
+
+  // used on /settings/profile
+  $('.account_display_name').on('input', e => {
+    $('.name-counter').text(30 - $(e.target).val().length)
+  });
+  $('.account_note').on('input', e => {
+    $('.note-counter').text(160 - $(e.target).val().length)
+  });
 });
-- 
cgit 

