diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 61e1a7ee1..f2e1af48f 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -194,19 +194,20 @@ async function getExpressionsList() { async function setExpression(character, expression, force) { const filename = `${expression}.png`; const debugImageStatus = document.querySelector(`#image_list div[id="${filename}"] span`); + const img = $('img.expression'); if (force || (debugImageStatus && !debugImageStatus.classList.contains('failure'))) { //console.log('setting expression from character images folder'); const imgUrl = `/characters/${character}/${filename}`; - $('img.expression').prop('src', imgUrl); - $('img.expression').removeClass('default'); + img.attr('src', imgUrl); + img.removeClass('default'); } else { if (extension_settings.expressions.showDefault) { //console.log('no character images, trying default expressions'); const defImgUrl = `/img/default-expressions/${filename}`; //console.log(defImgUrl); - $('img.expression').prop('src', defImgUrl); - $('img.expression').addClass('default'); + img.attr('src', defImgUrl); + img.addClass('default'); } } } @@ -233,19 +234,18 @@ function onClickExpressionImage() { function addSettings() { const html = `
You are in offline mode. Click on the image below to set the expression.
Hint: Create new folder in the public/characters/ folder and name it as the name of the character. Put PNG images with expressions there.
-