From 37f531b6da15256ad63f63665f4467909bbbb4f6 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 2 Mar 2012 11:29:09 +0530 Subject: [PATCH] fixes to profile update --- .../home/page/profile_settings/profile_settings.js | 14 +++++++++----- erpnext/startup/startup.js | 2 +- js/all-app.js | 2 +- js/all-web.js | 2 +- version.num | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/erpnext/home/page/profile_settings/profile_settings.js b/erpnext/home/page/profile_settings/profile_settings.js index 8ce94f8439..f1ee6ffc6d 100644 --- a/erpnext/home/page/profile_settings/profile_settings.js +++ b/erpnext/home/page/profile_settings/profile_settings.js @@ -31,8 +31,8 @@ MyProfile = function(wrapper) { this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}), 1, 2, '90%', ['50%', '50%'], {padding:'11px'}) - this.img = $a($td(this.tab, 0, 0), 'img'); - set_user_img(this.img, user); + this.img = $a($td(this.tab, 0, 0), 'img', '', {width: '120px', maxHeight:'200px'}); + this.img.src = wn.user_info(user).image; $btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image); @@ -135,14 +135,18 @@ MyProfile = function(wrapper) { } pscript.background_change = function(fid) { - //erpnext.set_background_image(fid); - pscript.open_dialog.hide(); + msgprint('File Uploaded'); + if(fid) { + erpnext.set_user_background(fid); + pscript.open_dialog.hide(); + } } pscript.user_image_upload = function(fid) { msgprint('File Uploaded'); if(fid) { pscript.open_dialog.hide(); - set_user_img(pscript.myprofile.img, user, null, fid); + wn.boot.user_info[user].image = 'files/' + fid; + pscript.myprofile.img.src = 'files/' + fid; } } diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 06890211b8..0a2ac23e1d 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -147,7 +147,7 @@ erpnext.startup.set_periodic_updates = function() { } erpnext.set_user_background = function(src) { - set_style(repl('body { background: url("files/%(src)s") repeat !important;}', {src:src})) + set_style(repl('body { background: url("files/%(src)s") repeat;}', {src:src})) } // start diff --git a/js/all-app.js b/js/all-app.js index 313beffb2f..424cc14c22 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2233,7 +2233,7 @@ if(!reset){$c_page('home','event_updates','get_unread_messages',null,function(r, if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});}else{page_body.wntoolbar.set_new_comments(0);$('#msg_count').toggle(false);}} erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);} wn.updates.id=setInterval(update_messages,60000);} -erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat !important;}',{src:src}))} +erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat;}',{src:src}))} $(document).bind('startup',function(){erpnext.startup.start();}); /* * erpnext/startup/js/modules.js diff --git a/js/all-web.js b/js/all-web.js index 4c6e6f4baa..ba88811148 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -1081,7 +1081,7 @@ if(!reset){$c_page('home','event_updates','get_unread_messages',null,function(r, if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});}else{page_body.wntoolbar.set_new_comments(0);$('#msg_count').toggle(false);}} erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);} wn.updates.id=setInterval(update_messages,60000);} -erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat !important;}',{src:src}))} +erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat;}',{src:src}))} $(document).bind('startup',function(){erpnext.startup.start();}); /* * erpnext/website/js/topbar.js diff --git a/version.num b/version.num index 7ab878c683..f9b0327477 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -814 +815 \ No newline at end of file