Ignore:
Timestamp:
10/20/08 01:35:42 (4 years ago)
Author:
hverton
Message:

fixed resizing error with multiple diff blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.svn.tpl

    r1880 r1886  
    7373        </style> 
    7474        {/literal} 
    75         <div id='codeblock.0' style='width:400px;'>{$output}</div> 
     75        <div id='codeblock.0.0' style='width:400px;'>{$output}</div> 
    7676    {else} 
    7777        <table cellspacing='0' cellpadding='0' align='center' width='100%'> 
    7878            <tr> 
    7979                <td class='tbl' align='center'> 
    80                     <div id='codeblock.0' style='width:400px;'>{$output.0}</div> 
     80                    <div id='codeblock.0.0' style='width:400px;'>{$output.0}</div> 
    8181                </td> 
    8282            </tr> 
     
    236236            <td class='tbl1' align='left' width='94%' style='font-family:monospace;font-size:120%;{$linecolor}'> 
    237237                {if $diffs[id].output[nr].line != ""} 
    238                     <div id='codeblock.{$smarty.section.id.index}' style='float:left;width:400px;white-space:nowrap;overflow:hidden;text-overflow:clip;'>{$diffs[id].output[nr].line}</div> 
     238                    <div id='codeblock.{$smarty.section.id.index}.{$smarty.section.nr.index}' style='float:left;width:400px;white-space:nowrap;overflow:hidden;text-overflow:clip;'>{$diffs[id].output[nr].line}</div> 
    239239                {/if} 
    240240            </td> 
     
    315315    var obj = 1; 
    316316    var i = 0; 
     317    var j = 0; 
    317318 
    318319    // set the width correctly 
    319     while (document.getElementById("codeblock." + i) != null) { 
    320         // get the info about the objects parent 
    321         obj = document.getElementById("codeblock." + i).parentNode; 
    322         // fall back gracefully if the parentNode can not be found 
    323         if (obj == null) obj = document.getElementById("codeblock." + i).offsetParent; 
    324         parent_left = findPosX(obj); 
    325         parent_width = obj.offsetWidth; 
    326         // calculate the new width of the block, leave plenty of space to handle browser subtleties  
    327         block_width = parent_left + parent_width - findPosX(document.getElementById("codeblock." + i)) - 20; 
    328         // adjust the width of the code blocks 
    329         document.getElementById("codeblock." + i).style.width = block_width + "px"; 
     320    while (document.getElementById("codeblock." + i + ".0") != null) { 
     321        j = 0; 
     322        while (document.getElementById("codeblock." + i + "." + j) != null) { 
     323            // get the info about the objects parent 
     324            obj = document.getElementById("codeblock." + i + "." + j).parentNode; 
     325            // fall back gracefully if the parentNode can not be found 
     326            if (obj == null) obj = document.getElementById("codeblock." + i + "." + j).offsetParent; 
     327            parent_left = findPosX(obj); 
     328            parent_width = obj.offsetWidth; 
     329            // calculate the new width of the block, leave plenty of space to handle browser subtleties  
     330            block_width = parent_left + parent_width - findPosX(document.getElementById("codeblock." + i + "." + j)) - 20; 
     331            // adjust the width of the code blocks 
     332            document.getElementById("codeblock." + i + "." + j).style.width = block_width + "px"; 
     333            j++; 
     334        } 
    330335        i++; 
    331336    } 
Note: See TracChangeset for help on using the changeset viewer.