Widget:costumeSwitcher: Difference between revisions
Jump to navigation
Jump to search
Set "autocomplete" from the costume selector off |
swap_costume now triggers "costume_changed" for all ".chibiAnimation,.live2dAnimation" in the surrounding ".costumeContainer" |
||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
function swap_costume() { | function swap_costume(element) { | ||
costumeSelectionPathsString = document.getElementById("costumeSelection").value; | costumeSelectionPathsString = document.getElementById("costumeSelection").value; | ||
costumeSelectionIndex = document.getElementById("costumeSelection").selectedIndex; | costumeSelectionIndex = document.getElementById("costumeSelection").selectedIndex; | ||
Line 10: | Line 8: | ||
chibiCostumeName = "_costume" + costumeSelectionIndex | chibiCostumeName = "_costume" + costumeSelectionIndex | ||
} | } | ||
$(element).closest('.costumeContainer').find('.chibiAnimation,.live2dAnimation').trigger("costume_changed", chibiCostumeName); | |||
costumePaths = costumeSelectionPathsString.split(",,"); | costumePaths = costumeSelectionPathsString.split(",,"); | ||
Line 46: | Line 43: | ||
} | } | ||
</script><select | </script><select class="skill" style="background-color:rgba(250,250,250,0.9);width:100%" autocomplete="off" onchange="swap_costume(this)" > | ||
<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected">Default</option> | <option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected">Default</option> | ||
<!--{if $costume1name neq ''}--><option value="<!--{$costume1paths|escape:'html'}-->"><!--{$costume1name|escape:'html'}--></option><!--{/if}--> | <!--{if $costume1name neq ''}--><option value="<!--{$costume1paths|escape:'html'}-->"><!--{$costume1name|escape:'html'}--></option><!--{/if}--> |