Add button to clear selected textures in closet

This commit is contained in:
printempw 2018-02-24 18:14:15 +08:00
parent 4c54a391be
commit 62af291091
4 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* global initSkinViewer, applySkinViewerConfig */
/* global initSkinViewer, applySkinViewerConfig, defaultSteveSkin */
'use strict';
@ -59,6 +59,18 @@ $('body').on('click', '.category-switch', () => {
reloadCloset(category, page, search);
});
$('#closet-reset').click(() => {
const $indicator = $('#textures-indicator');
$indicator.text('');
$indicator.removeData('skin');
$indicator.removeData('cape');
$.msp.config.skinUrl = defaultSteveSkin;
$.msp.config.capeUrl = '';
$.msp.config.slim = false;
initSkinViewer();
});
async function initCloset() {
if ($('#closet-container').length !== 1)
return;

View File

@ -38,6 +38,7 @@ closet:
use-as:
button: Apply...
reset: Clear selected
title: Which player should be applied to?
empty: It seems that you own no player...
add: Add new player

View File

@ -45,6 +45,7 @@ closet:
use-as:
button: 使用...
reset: 重置已选材质
title: 要给哪个角色使用呢?
empty: 你好像还没有添加任何角色哦
add: 添加角色

View File

@ -57,6 +57,7 @@
<div class="box-footer">
<button class="btn btn-primary" data-toggle="modal" data-target="#modal-use-as">{{ trans('user.closet.use-as.button') }}</button>
<button class="btn btn-default pull-right" id="closet-reset">{{ trans('user.closet.use-as.reset') }}</button>
</div><!-- /.box-footer -->
</div>
</div>