From 41592d030752bfd07d155d3cc8b2136acf39b435 Mon Sep 17 00:00:00 2001 From: Pepf Date: Mon, 14 Jul 2014 14:35:21 +0200 Subject: [PATCH] use autoform for avatar updates --- client/views/userProfile.html | 7 +------ client/views/userProfile.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/client/views/userProfile.html b/client/views/userProfile.html index d590ad8..c76feda 100644 --- a/client/views/userProfile.html +++ b/client/views/userProfile.html @@ -79,12 +79,7 @@

{{this.username}}

diff --git a/client/views/userProfile.js b/client/views/userProfile.js index e690ccc..21df940 100644 --- a/client/views/userProfile.js +++ b/client/views/userProfile.js @@ -35,17 +35,15 @@ Template.userPlaylist.songCount = function() { } }; -Template.editAvatar.events = { - 'click [data-action="update-avatar"]': function() { - var avatar = $("input#avatarUrl").val(); - check(avatar,String); - Meteor.users.update( - {_id: Meteor.userId()}, - {$set: {'profile.avatar':avatar}}); - Session.set("showEditAvatarBar",false); - } +Template.editAvatar.currentAvatar = function () { + return Meteor.user(); }; +Template.editAvatar.users = function () { + return Meteor.users; +}; + + Template.addRemoveFriend.isFriend = function() { return _.contains(Meteor.user().profile.friends,this._id); };