Improved template for multilingualism
authorAlexander Ebert <ebert@woltlab.com>
Mon, 21 May 2012 14:41:22 +0000 (16:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 21 May 2012 14:41:22 +0000 (16:41 +0200)
acptemplates/languageMultilingualism.tpl

index eafb1870ecdfc830db06a36933fa855c2e5325d7..52235d78a1585a39c251a331f1c91a7efb514ec8 100644 (file)
@@ -2,11 +2,11 @@
 
 <script type="text/javascript">
        //<![CDATA[
-       {if $enable == 0}
-               $(function () {
-                       $('#languageIDs').hide();
-               });
-       {/if}
+       $(function() {
+               var $languageIDs = $('#languageIDs');
+               $('#enable').click(function() { $languageIDs.toggle(); });
+               {if !$enable}$languageIDs.hide();{/if}
+       });
        //]]>
 </script>
 
 <form enctype="multipart/form-data" method="post" action="{link controller='LanguageMultilingualism'}{/link}">
        <div class="container containerPadding marginTop shadow">
                <fieldset>
-                       <legend><label><input type="checkbox" id="enable" onclick="if (this.checked) $('#languageIDs').show(); else $('#languageIDs').hide();" name="enable" value="1" {if $enable == 1}checked="checked" {/if}/> {lang}wcf.acp.language.multilingualism.enable{/lang}</label></legend>
+                       <legend><label><input type="checkbox" id="enable" name="enable" value="1" {if $enable}checked="checked" {/if}/> {lang}wcf.acp.language.multilingualism.enable{/lang}</label></legend>
                        <small>{lang}wcf.acp.language.multilingualism.enable.description{/lang}</small>
                
-                       <dl{if $errorField == 'languageFile'} class="formError"{/if} id="languageIDs">
+                       <dl id="languageIDs" class="marginTop{if $errorField == 'languageIDs'} formError{/if}">
                                <dt><label for="languageIDs">{lang}wcf.acp.language.multilingualism.languages{/lang}</label></dt>
                                <dd class="floated">
                                        {htmlCheckboxes options=$languages name=languageIDs selected=$languageIDs disableEncoding=true}