From 249c9f290d515434ace64d9203c95a8bd3423a85 Mon Sep 17 00:00:00 2001 From: printempw Date: Sat, 24 Feb 2018 00:08:00 +0800 Subject: [PATCH] Avoid operating skinViewer instance directly outside the module --- resources/assets/src/js/user/closet.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/assets/src/js/user/closet.js b/resources/assets/src/js/user/closet.js index 12666077..88f2c73e 100644 --- a/resources/assets/src/js/user/closet.js +++ b/resources/assets/src/js/user/closet.js @@ -1,4 +1,4 @@ -/* global initSkinViewer */ +/* global initSkinViewer, applySkinViewerConfig */ 'use strict'; @@ -21,10 +21,10 @@ $('body').on('click', '.item-body', async function () { }); if (type === 'cape') { - $.msp.viewer.capeUrl = $.msp.config.capeUrl = url(`textures/${hash}`); + $.msp.config.capeUrl = url(`textures/${hash}`); $indicator.data('cape', tid); } else { - $.msp.viewer.skinUrl = $.msp.config.skinUrl = url(`textures/${hash}`); + $.msp.config.skinUrl = url(`textures/${hash}`); $indicator.data('skin', tid); } @@ -32,6 +32,8 @@ $('body').on('click', '.item-body', async function () { // Reset skinview3d to change model $.msp.config.slim = (type === 'alex'); initSkinViewer(); + } else { + applySkinViewerConfig(); } const skin = $indicator.data('skin');