added popup to change nickname (must create lib.content-controller.change_username())

This commit is contained in:
xdrm-brackets 2018-03-28 19:54:16 +02:00
parent 4a101ee576
commit 5bad9bfc73
4 changed files with 45 additions and 4 deletions

View File

@ -38,6 +38,14 @@ export default class PopupController{
reset(){ this.data.link = '', this.data.name = ''; },
submit(){ gs.get.channel.create(this.data.name, this.data.link) && this.parent.hide(); }
});
/* (3) Change nickname */
this.register('nickname.change', {
data: {
value: ''
},
reset(){ this.data.value = ''; },
submit(){ gs.get.content.change_username(this.data.value) && this.parent.hide(); }
});
}

View File

@ -90,6 +90,22 @@
align-items: stretch;
flex-wrap: nowrap;
a{
display: inline-block;
font-size: .8em;
color: #aaa;
cursor: pointer;
&:after{ content: none; }
&:hover{
text-decoration: underline;
color: #fff;
}
}
}

View File

@ -94,10 +94,10 @@
<div class='body'>
<div v-show='minipop' class='minipopup'>
<span class='special sa' @click=''>Invite people</span>
<span class='special sa' @click='gs.popup.show(`user.invite`); minipop=false'>Invite people</span>
<span data-icon='create' @click='gs.popup.show(`channel.create`); minipop=false'>Create channel</span>
<span data-icon='category' @click='gs.popup.show(`room.create`); minipop=false'>Create room</span>
<span data-icon='edit' @click=''>Change nickname</span>
<span data-icon='edit' @click='gs.popup.show(`nickname.change`); minipop=false'>Change nickname</span>
<span class='sb invalid' data-icon='logout' @click='gs.auth.token=null; gs.refresh()'>Logout</span>
</div>

View File

@ -52,6 +52,23 @@
</span>
</div>
<!-- Pop-up NICKNAME CHANGE -->
<div class='popup' v-show='gs.popup.get(`nickname.change`).active'>
<span class='header'>Change nickname</span>
<span class='body form'>
<label for='nickname'>Nickname</label>
<input type='text' name='nickname' v-model='gs.popup.get(`nickname.change`).data.value' :placeholder='gs.auth.user.username'>
<a @click='gs.popup.get(`nickname.change`).reset()'>Reset Nickname</a>
</span>
<span class='footer form'>
<button @click='gs.popup.hide()'>Cancel</button>
<button class='submit' @click='gs.popup.get(`nickname.change`).submit()'>Save</button>
</span>
</div>
</div>