Small code optimization
authorMarcel Werk <burntime@woltlab.com>
Tue, 28 Jun 2016 09:10:07 +0000 (11:10 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 28 Jun 2016 13:57:56 +0000 (15:57 +0200)
wcfsetup/install/files/acp/templates/pageAdd.tpl

index efc5a834fb5267019474a645747ba079c81776fd..cd42beea0a934d498fa9e2fc95a2f8439a87fbc8 100644 (file)
 
 {if $action == 'add'}
        <script data-relocate="true">
-               elBySel('#name').addEventListener('blur', function() {
-                       var name = elBySel('#name').value;
+               elById('name').addEventListener('blur', function() {
+                       var name = this.value;
                        name = name.replace(/ /g, '-');
                        name = name.replace(/[^a-z0-9-]/gi, '');
                        
                        {if !$isMultilingual}
-                               if (elBySel('#customURL').value === '') {
-                                       elBySel('#customURL').value = name;
+                               if (elById('customURL').value === '') {
+                                       elById('customURL').value = name;
                                }
                        {else}
                                {foreach from=$availableLanguages item=availableLanguage}
-                                       if (elBySel('#customURL{@$availableLanguage->languageID}').value === '') {
-                                               elBySel('#customURL{@$availableLanguage->languageID}').value = name + '-{@$availableLanguage->languageCode}';
+                                       if (elById('customURL{@$availableLanguage->languageID}').value === '') {
+                                               elById('customURL{@$availableLanguage->languageID}').value = name + '-{@$availableLanguage->languageCode}';
                                        }
                                {/foreach}
                        {/if}