From 2b1aeafcd8f46660d383f0af2c2c8adedb48a5aa Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Sun, 1 May 2016 19:16:19 +0300 Subject: [PATCH] javascript load for user_biography --- app/assets/javascripts/osem.js | 9 --------- app/views/users/edit.html.haml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index aede8208..039daa79 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -1,13 +1,4 @@ $(function () { - - /** - * Show the number of words in the biography text field when opening the - * profile edit page - */ - $(document).ready(function(){ - word_count($("#user_biography")[0], 'bio_length', 150); - }); - /** * Update the number of words in the biography text field every time the user * releases a key on the keyboard diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 3c33f72a..28ea3fb6 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -17,7 +17,7 @@ = f.input :biography, input_html: { rows: 5, 'onkeyup' => "word_count(this, 'biography-count', 150)" } You have used %span#bio_length - 0 + = @user.biography.split.length words. Biographies are limited to 150 words. %br %br