Widget:costumeSwitcher: Difference between revisions
Jump to navigation
Jump to search
swap_costume now triggers "costume_changed" for all ".chibiAnimation,.live2dAnimation" in the surrounding ".costumeContainer" |
Select Box reference corrected |
||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
function swap_costume(element) { | function swap_costume(element) { | ||
costumeSelectionPathsString = | var selectBox = $(element); | ||
costumeSelectionIndex = | |||
costumeSelectionPathsString = selectBox.value(); | |||
costumeSelectionIndex = selectBox.prop('selectedIndex'); | |||
var chibiCostumeName = ""; | var chibiCostumeName = ""; | ||
Line 9: | Line 11: | ||
} | } | ||
selectBox.closest('.costumeContainer').find('.chibiAnimation,.live2dAnimation').trigger("costume_changed", chibiCostumeName); | |||
costumePaths = costumeSelectionPathsString.split(",,"); | costumePaths = costumeSelectionPathsString.split(",,"); |