Merge pull request #1885 from houqp/issue_1776
when user changes displayName, also update it on expand button
This commit is contained in:
commit
072daf8850
|
@ -34,7 +34,7 @@
|
|||
|
||||
<ul id="settings" class="svg">
|
||||
<span id="expand">
|
||||
<?php echo $_['user_displayname'] ?>
|
||||
<span id="expandDisplayName"><?php echo $_['user_displayname'] ?></span>
|
||||
<img class="svg" src="<?php echo image_path('', 'actions/caret.svg'); ?>" />
|
||||
</span>
|
||||
<div id="expanddiv">
|
||||
|
|
|
@ -31,7 +31,7 @@ $(document).ready(function(){
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#displaynamebutton").click( function(){
|
||||
if ($('#displayName').val() != '' ) {
|
||||
// Serialize the data
|
||||
|
@ -42,6 +42,9 @@ $(document).ready(function(){
|
|||
$.post( 'ajax/changedisplayname.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
$('#displaynamechanged').show();
|
||||
$('#oldDisplayName').text($('#displayName').val());
|
||||
// update displayName on the top right expand button
|
||||
$('#expandDisplayName').text($('#displayName').val());
|
||||
}
|
||||
else{
|
||||
$('#newdisplayname').val(data.data.displayName)
|
||||
|
|
Loading…
Reference in New Issue