瀏覽代碼

Fix show and hide status code

Jaap Marcus 5 年之前
父節點
當前提交
b8ebc1904d
共有 2 個文件被更改,包括 23 次插入23 次删除
  1. 3 3
      web/js/pages/edit_web.js
  2. 20 20
      web/templates/admin/edit_web.html

+ 3 - 3
web/js/pages/edit_web.js

@@ -295,9 +295,9 @@ function elementHideShow(elementToHideOrShow){
     el.style.display = el.style.display === 'none' ? 'block' : 'none';
     el.style.display = el.style.display === 'none' ? 'block' : 'none';
 }
 }
 
 
-$('#v-redirect-custom-value').change( function(){
-    console.log($('#v-redirect-custom-value').is(":checked"));
-    if($('#v-redirect-custom-value').is(":checked")){
+$('.v-redirect-custom-value').change( function(){
+    
+    if(this.value == "custom"){
         $('#custom_redirect').show();
         $('#custom_redirect').show();
     }else{
     }else{
         $('#custom_redirect').hide();
         $('#custom_redirect').hide();

+ 20 - 20
web/templates/admin/edit_web.html

@@ -325,9 +325,9 @@
                                     <table style="display:<?php if (empty($v_redirect)) { echo 'none';} else {echo 'block';}?> ;" id="v_redirect">
                                     <table style="display:<?php if (empty($v_redirect)) { echo 'none';} else {echo 'block';}?> ;" id="v_redirect">
                                         <tr>
                                         <tr>
                                             <td class="step-top">
                                             <td class="step-top">
-                                                <input type="radio" name="v-redirect" value="<?php echo 'www.'.$v_domain;?>" <?php if ($v_redirect == "www.".$v_domain) echo "checked"; ?>/><?=sprintf(_('Redirect visitors to %s'),"www.".$v_domain);?><br />
-                                                <input type="radio" name="v-redirect" value="<?php echo $v_domain;?>" <?php if( $v_redirect == $v_domain) echo "checked";?>/><?=sprintf(_('Redirect visitors to %s'),$v_domain);?><br />
-                                                <input type="radio" name="v-redirect" value="custom" <?php if( !empty($v_redirect_custom)) echo "checked";?> id="v-redirect-custom-value"/><?=_("Redirect visitors to a custom domain or web address");?>
+                                                <input type="radio" name="v-redirect" value="<?php echo 'www.'.$v_domain;?>" <?php if ($v_redirect == "www.".$v_domain) echo "checked"; ?> class="v-redirect-custom-value"/><?=sprintf(_('Redirect visitors to %s'),"www.".$v_domain);?><br />
+                                                <input type="radio" name="v-redirect" value="<?php echo $v_domain;?>" <?php if( $v_redirect == $v_domain) echo "checked";?> class="v-redirect-custom-value"/><?=sprintf(_('Redirect visitors to %s'),$v_domain);?><br />
+                                                <input type="radio" name="v-redirect" value="custom" <?php if( !empty($v_redirect_custom)) echo "checked";?> class="v-redirect-custom-value"/><?=_("Redirect visitors to a custom domain or web address");?>
                                             </td>
                                             </td>
                                         </tr>
                                         </tr>
                                         <tr>
                                         <tr>
@@ -343,26 +343,26 @@
                                                             <input type="text" name="v-redirect-custom" class="vst-input" value="<?=$v_redirect_custom;?>" />
                                                             <input type="text" name="v-redirect-custom" class="vst-input" value="<?=$v_redirect_custom;?>" />
                                                         </td>
                                                         </td>
                                                     </tr>
                                                     </tr>
+                                                    <tr>
+                                                        <td class="vst-text input-label">
+                                                           <?=_('Status code');?>:
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="vst-text input-label">
+                                                            <select  class="vst-list" name="v-redirect-code">
+                                                                <?php foreach ($redirect_code_options as $status_code): ?>
+                                                                    <option value="<?php echo $status_code;?>"
+                                                                        <?=($v_redirect_code === $status_code || (empty($v_redirect_code) && $status_code === $v_redirect_code))?' selected="selected" ':''; ?>>
+                                                                        <?php echo $status_code;?>
+                                                                    </option>
+                                                                <?php endforeach; ?>
+                                                            </select>
+                                                        </td>
+                                                    </tr>
                                                 </table>   
                                                 </table>   
                                             </td>
                                             </td>
                                         </tr>
                                         </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                               <?=_('Status code');?>:
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <select  class="vst-list" name="v-redirect-code">
-                                                    <?php foreach ($redirect_code_options as $status_code): ?>
-                                                        <option value="<?php echo $status_code;?>"
-                                                            <?=($v_redirect_code === $status_code || (empty($v_redirect_code) && $status_code === $v_redirect_code))?' selected="selected" ':''; ?>>
-                                                            <?php echo $status_code;?>
-                                                        </option>
-                                                    <?php endforeach; ?>
-                                                </select>
-                                            </td>
-                                        </tr>
                                     </table>
                                     </table>
                                 </td>
                                 </td>
                             </tr>
                             </tr>