Changeset 23487


Ignore:
Timestamp:
2014/06/02 11:32:52 (9 years ago)
Author:
pineray
Message:

#2210 商品種別が通常商品の場合は、ダウンロード商品に関するフォームを非表示

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/Smarty/templates/admin/products/product.tpl

    r23473 r23487  
    2323*}--> 
    2424<script type="text/javascript"> 
    25 // 表示非表示切り替え 
    26 function lfDispSwitch(id){ 
    27     var obj = document.getElementById(id); 
    28     if (obj.style.display == 'none') { 
    29         obj.style.display = ''; 
    30     } else { 
    31         obj.style.display = 'none'; 
     25    // 表示非表示切り替え 
     26    function lfDispSwitch(id){ 
     27        var obj = document.getElementById(id); 
     28        if (obj.style.display == 'none') { 
     29            obj.style.display = ''; 
     30        } else { 
     31            obj.style.display = 'none'; 
     32        } 
    3233    } 
    33 } 
    34  
    35 // セレクトボックスのリストを初期化 
    36 // ※キャッシュ対策 
    37 // (移動元セレクトボックス) 
    38 function fnInitSelect(select) { 
    39     var selectedOptions = <!--{$tpl_json_category_id}-->; 
    40     $('#' + select + ' option').attr('selected', false); 
    41     for(var i=0; i<selectedOptions.length; i++){ 
    42         $('#' + select + ' option[value="' + selectedOptions[i] + '"]') 
    43             .attr('selected', 'selected'); 
     34 
     35    // セレクトボックスのリストを初期化 
     36    // ※キャッシュ対策 
     37    // (移動元セレクトボックス) 
     38    function fnInitSelect(select) { 
     39        var selectedOptions = <!--{$tpl_json_category_id}-->; 
     40        $('#' + select + ' option').attr('selected', false); 
     41        for(var i=0; i<selectedOptions.length; i++){ 
     42            $('#' + select + ' option[value="' + selectedOptions[i] + '"]') 
     43                .attr('selected', 'selected'); 
     44        } 
    4445    } 
    45 } 
    46  
    47 // セレクトボックスのリストを移動 
    48 // (移動元セレクトボックスID, 移動先セレクトボックスID) 
    49 function fnMoveSelect(select, target) { 
    50     $('#' + select).children().each(function() { 
    51         if (this.selected) { 
    52             $('#' + target).append(this); 
    53             $(this).attr({selected: false}); 
     46 
     47    // セレクトボックスのリストを移動 
     48    // (移動元セレクトボックスID, 移動先セレクトボックスID) 
     49    function fnMoveSelect(select, target) { 
     50        $('#' + select).children().each(function() { 
     51            if (this.selected) { 
     52                $('#' + target).append(this); 
     53                $(this).attr({selected: false}); 
     54            } 
     55        }); 
     56        // IE7再描画不具合対策 
     57        var ua = navigator.userAgent.toLowerCase(); 
     58        if (ua.indexOf("msie") != -1 && ua.indexOf('msie 6') == -1) { 
     59            $('#' + select).hide(); 
     60            $('#' + select).show(); 
     61            $('#' + target).hide(); 
     62            $('#' + target).show(); 
    5463        } 
    55     }); 
    56     // IE7再描画不具合対策 
    57     var ua = navigator.userAgent.toLowerCase(); 
    58     if (ua.indexOf("msie") != -1 && ua.indexOf('msie 6') == -1) { 
    59         $('#' + select).hide(); 
    60         $('#' + select).show(); 
    61         $('#' + target).hide(); 
    62         $('#' + target).show(); 
    6364    } 
    64 } 
    65  
    66 // target の子要素を選択状態にする 
    67 function selectAll(target) { 
    68     $('#' + target).children().attr({selected: true}); 
    69 } 
    70  
     65 
     66    // target の子要素を選択状態にする 
     67    function selectAll(target) { 
     68        $('#' + target).children().attr({selected: true}); 
     69    } 
     70 
     71    // 商品種別によってダウンロード商品のフォームの表示非表示を切り替える 
     72    function toggleDownloadFileForms(value) { 
     73        if (value == '2') { 
     74            $('.type-download').show('fast'); 
     75        } else { 
     76            $('.type-download').hide('fast'); 
     77        } 
     78    } 
     79 
     80    $(function(){ 
     81        var form_product_type = $('input[name=product_type_id]'); 
     82        form_product_type.click(function(){ 
     83            toggleDownloadFileForms(form_product_type.filter(':checked').val()); 
     84        }); 
     85        toggleDownloadFileForms(form_product_type.filter(':checked').val()); 
     86    }) 
    7187</script> 
    7288 
     
    152168            </td> 
    153169        </tr> 
    154         <tr> 
     170        <tr class="type-download"> 
    155171            <th>ダウンロード商品ファイル名<span class="attention"> *</span></th> 
    156172            <td> 
     
    160176            </td> 
    161177        </tr> 
    162         <tr> 
     178        <tr class="type-download"> 
    163179            <!--{assign var=key value="down_file"}--> 
    164180            <th>ダウンロード商品用<br />ファイルアップロード<span class="attention"> *</span></th> 
Note: See TracChangeset for help on using the changeset viewer.