Fixed style editor issue
authorMarcel Werk <burntime@woltlab.com>
Thu, 9 May 2013 12:43:38 +0000 (14:43 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 9 May 2013 12:43:38 +0000 (14:43 +0200)
wcfsetup/install/files/acp/templates/styleAdd.tpl

index cd19b73b7025ad12ba90ee4ebd94b673602f2bf4..a1f213def2630cbb3d7e893bec53e8daecc17eec 100644 (file)
                                'wcf.acp.style.copyStyle.confirmMessage': '{lang}wcf.acp.style.copyStyle.confirmMessage{/lang}'
                        });
                {/if}
+               
+               $('.jsUnitSelect').change(function(event) {
+                       var $target = $(event.currentTarget);
+                       $target.prev().attr('step', ($target.val() == 'em' ? '0.01' : '1'));
+               }).trigger('change');
        });
        //]]>
 </script>
                                        <dt><label for="wcfLayoutFluidGap">{lang}wcf.acp.style.globals.fluidLayoutGap{/lang}</label></dt>
                                        <dd>
                                                <input type="number" id="wcfLayoutFluidGap" name="wcfLayoutFluidGap" value="{@$variables[wcfLayoutFluidGap]}" class="tiny" />
-                                               <select name="wcfLayoutFluidGap_unit">
+                                               <select name="wcfLayoutFluidGap_unit" class="jsUnitSelect">
                                                        {foreach from=$availableUnits item=unit}
                                                                <option value="{@$unit}"{if $variables[wcfLayoutFluidGap_unit] == $unit} selected="selected"{/if}>{@$unit}</option>
                                                        {/foreach}
                                        <dt><label for="wcfLayoutFixedWidth">{lang}wcf.acp.style.globals.fixedLayoutWidth{/lang}</label></dt>
                                        <dd>
                                                <input type="number" id="wcfLayoutFixedWidth" name="wcfLayoutFixedWidth" value="{@$variables[wcfLayoutFixedWidth]}" class="tiny" />
-                                               <select name="wcfLayoutFixedWidth_unit">
+                                               <select name="wcfLayoutFixedWidth_unit" class="jsUnitSelect">
                                                        {foreach from=$availableUnits item=unit}
                                                                <option value="{@$unit}"{if $variables[wcfLayoutFixedWidth_unit] == $unit} selected="selected"{/if}>{@$unit}</option>
                                                        {/foreach}
                                        <dt><label for="wcfBaseFontSize">{lang}wcf.acp.style.globals.fontSize{/lang}</label></dt>
                                        <dd>
                                                <input type="number" id="wcfBaseFontSize" name="wcfBaseFontSize" value="{@$variables[wcfBaseFontSize]}" class="tiny" />
-                                               <select name="wcfBaseFontSize_unit">
+                                               <select name="wcfBaseFontSize_unit" class="jsUnitSelect">
                                                        {foreach from=$availableUnits item=unit}
                                                                <option value="{@$unit}"{if $variables[wcfBaseFontSize_unit] == $unit} selected="selected"{/if}>{@$unit}</option>
                                                        {/foreach}