Changeset 1659 in ExiteCMS for trunk/includes/templates/forum.viewthread.tpl
- Timestamp:
- 08/19/08 19:20:49 (4 years ago)
- File:
-
- 1 edited
-
trunk/includes/templates/forum.viewthread.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/templates/forum.viewthread.tpl
r1651 r1659 21 21 </script> 22 22 {include file="_opentable.tpl" name=$_name title=$locale.500 state=$_state style=$_style} 23 <table id='width_check'cellspacing='0' cellpadding='0' width='100%'>23 <table cellspacing='0' cellpadding='0' width='100%'> 24 24 <tr> 25 25 <td class='smallalt'> … … 199 199 if (_timer) clearInterval(_timer); 200 200 201 // calculate the width of a code block 202 var blockwidth = document.getElementById("width_check").offsetWidth-141; 203 var block_a = 0; 204 var block_b = 0; 201 // needed inside the loop 202 var parent_left = 0; 203 var parent_width = 0; 204 var obj = 1; 205 var i = 1; 205 206 206 207 // loop through all blocks found, and set the width correctly 207 var i = 1;208 208 while (document.getElementById("codeblock"+i+"a") != null && document.getElementById("codeblock"+i+"b") != null) { 209 // need to check and do something dynamic with margins and padding here... 210 block_a = blockwidth - 40 + "px"; 211 block_b = blockwidth - 50 + "px"; 212 document.getElementById("codeblock"+i+"a").style.width = block_a; 213 document.getElementById("codeblock"+i+"b").style.width = block_b; 209 // get the info about the objects parent 210 obj = document.getElementById("codeblock"+i+"a").parentNode; 211 // fall back gracefully if the parentNode can not be found 212 if (obj == null) obj = document.getElementById("codeblock"+i+"a").offsetParent; 213 parent_left = findPosX(obj); 214 parent_width = obj.offsetWidth; 215 // alert(parent_left + " : " + parent_width); 216 // calculate the new width of the block, leave plenty of space to handle browser subtleties 217 block_width = parent_left + parent_width - findPosX(document.getElementById("codeblock"+i+"a")) - 30; 218 // adjust the width of the code blocks 219 document.getElementById("codeblock"+i+"a").style.width = block_width + "px"; 220 document.getElementById("codeblock"+i+"b").style.width = block_width - 10 + "px"; 214 221 i++; 215 222 }
Note: See TracChangeset
for help on using the changeset viewer.
