* refactory loadList.

This commit is contained in:
chencongzhi520@gmail.com
2012-05-29 08:20:37 +00:00
parent 863f24aa9f
commit 7badaca084
2 changed files with 11 additions and 7 deletions
+4 -1
View File
@@ -33,7 +33,10 @@
<td><?php echo $i+1;?></td>
<td><?php echo html::select("types[$i]", $lang->todo->typeList, '', "onchange=loadList(this.value,$i+1) class='select-1'");?></td>
<td><?php echo html::select("pris[$i]", $lang->todo->priList, $pri, 'class=select-1');?></td>
<td><div id='<?php echo "nameBox" . ($i+1);?>' class='nameBox'><?php echo html::input("names[$i]", '', 'class="f-left text-1"'); echo "<span class='star'>*</span>";?></div></td>
<td>
<div id='<?php echo "nameBox" . ($i+1);?>' class='hidden'><?php echo html::input("names[$i]", '', 'class="f-left text-1"'); echo "<span class='star'>*</span>";?></div>
<div class='<?php echo "nameBox" . ($i+1);?>'><?php echo html::input("names[$i]", '', 'class="f-left text-1"'); echo "<span class='star'>*</span>";?></div>
</td>
<td><?php echo html::textarea("descs[$i]", '', "rows='2' class=text-1");?></td>
<td><?php echo html::select('begins[]', $times, '') . html::select('ends[]', $times, '');?><td>
</tr>
+7 -6
View File
@@ -1,17 +1,18 @@
<script language='Javascript'>
account='<?php echo $app->user->account;?>';
customHtml = $('.nameBox').html();
function loadList(type, id)
{
if(id)
{
divID = '#nameBox' + id;
customHtml = customHtml.replace('nameBox', 'nameBox' + id);
divClass = '.nameBox' + id;
divID = '#nameBox' + id;
}
else
{
divID = '#nameBox';
divClass = '.nameBox';
divID = '#nameBox';
}
customHtml = $(divID).html();
if(type == 'bug')
{
@@ -38,11 +39,11 @@ function loadList(type, id)
if(type == 'bug' || type == 'task')
{
$(divID).load(link);
$(divClass).load(link);
}
else if(type == 'custom')
{
$(divID).html(customHtml);
$(divClass).html(customHtml);
}
}