Add default value when renaming closet item

This commit is contained in:
gplane 2017-04-22 09:17:39 +08:00
parent 2b0f8b20c1
commit e708c0363e
2 changed files with 3 additions and 2 deletions

View File

@ -81,10 +81,11 @@ function showPlayerTexturePreview(pid) {
});
}
function renameClosetItem(tid) {
function renameClosetItem(tid, oldName) {
swal({
title: trans('user.renameClosetItem'),
input: 'text',
inputValue: oldName,
showCancelButton: true,
inputValidator: function(value) {
return new Promise(function(resolve, reject) {

View File

@ -12,7 +12,7 @@
<span title="{{ trans('user.closet.more') }}" class="more" data-toggle="dropdown" aria-haspopup="true" id="more-button"><i class="fa fa-cog"></i></span>
<ul class="dropup dropdown-menu" aria-labelledby="more-button">
<li><a href="javascript:renameClosetItem({{ $item->tid }});">{{ trans('user.closet.rename.title') }}</a></li>
<li><a href="javascript:renameClosetItem({{ $item->tid }}, '{{ $item->name }}');">{{ trans('user.closet.rename.title') }}</a></li>
<li><a href="javascript:removeFromCloset({{ $item->tid }});">{{ trans('user.closet.remove.title') }}</a></li>
<li><a href="javascript:setAsAvatar({{ $item->tid }});">{{ trans('user.closet.set-avatar') }}</a></li>
</ul>