* Finish task #41437.
This commit is contained in:
+10
-6
@@ -3,21 +3,25 @@ $(document).ready(function()
|
||||
$('#files').change(function(){$('#avatarForm').submit();});
|
||||
|
||||
$.setAjaxForm('#avatarForm', function(response)
|
||||
{
|
||||
{
|
||||
if(response.result == 'success')
|
||||
{
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
{
|
||||
$('#avatarUploadBtn').popover('destroy');
|
||||
$('#ajaxModal').load(response.locate);
|
||||
}, 800);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#avatarUploadBtn').on('click', function()
|
||||
{
|
||||
{
|
||||
$('#files').click();
|
||||
});
|
||||
|
||||
window.parent.$('#main-avatar, #menu-avatar').html('<img src="' + avatar + '"/>');
|
||||
window.parent.$('#mainContent>.cell>.main-header>.avatar').html('<img src="' + avatar + '"/>');
|
||||
window.parent.$('#mainContent .avatar-' + account).html('<img src="' + avatar + '"/>');
|
||||
});
|
||||
|
||||
function uploadAvatar()
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('avatar', $this->app->user->avatar);?>
|
||||
<?php js::set('account', $this->app->user->account);?>
|
||||
<div id='mainContent'>
|
||||
<div class='cell'>
|
||||
<div class='main-header text-center'>
|
||||
|
||||
@@ -1141,6 +1141,7 @@ class user extends control
|
||||
|
||||
$this->app->user->avatar = $image->webPath;
|
||||
$this->session->set('user', $this->app->user);
|
||||
$this->dao->update(TABLE_USER)->set('avatar')->eq($image->webPath)->where('account')->eq($this->app->user->account)->exec();
|
||||
exit('success');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user