From 63be875daaed5857c8b58b935028c624f60a6e5e Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 16:18:53 -0400 Subject: [PATCH] header/userpicture, header/profilelink, header/username components --- public/src/client/account/edit.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/public/src/client/account/edit.js b/public/src/client/account/edit.js index f7896baa90..eb651ca677 100644 --- a/public/src/client/account/edit.js +++ b/public/src/client/account/edit.js @@ -87,18 +87,20 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'], } function updateHeader(picture, username, userslug) { - if (parseInt(ajaxify.data.theirid, 10) !== parseInt(ajaxify.data.yourid, 10)) { - return; - } + require(['components'], function(components) { + if (parseInt(ajaxify.data.theirid, 10) !== parseInt(ajaxify.data.yourid, 10)) { + return; + } - if (picture) { - $('#user-header-picture').attr('src', picture); - } + if (picture) { + components.get('header/userpicture').attr('src', picture); + } - if (username && userslug) { - $('#user-profile-link').attr('href', config.relative_path + '/user/' + userslug); - $('#user-header-name').text(username); - } + if (username && userslug) { + components.get('header/profilelink').attr('href', config.relative_path + '/user/' + userslug); + components.get('header/username').text(username); + } + }); } function handleImageChange() {