Skip to content

Commit

Permalink
Fixed issue #08002: Click on delete one answer delete 2 answers
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jul 13, 2013
1 parent adc34f8 commit 0b575e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -52,7 +52,7 @@

<?php for ($scale_id = 0; $scale_id < $scalecount; $scale_id++)
{
$position=0;
$position=1;
if ($scalecount>1)
{ ?>
<div class='header ui-widget-header' style='margin-top:5px;'><?php echo sprintf($clang->gT("Answer scale %s"),$scale_id+1); ?></div>
Expand Down Expand Up @@ -91,7 +91,6 @@
$row['answer']=htmlspecialchars($row['answer']);
?>
<tr class='row_<?php echo $position; ?><?php if ($alternate==true){ ?> highlight<?php } ?><?php $alternate=!$alternate; ?>'><td>

<?php if ($first)
{ ?>
<img class='handle' src='<?php echo $sImageURL; ?>handle.png' alt=''/></td><td><input type='hidden' class='oldcode' id='oldcode_<?php echo $position; ?>_<?php echo $scale_id; ?>' name='oldcode_<?php echo $position; ?>_<?php echo $scale_id; ?>' value="<?php echo $row['code']; ?>" /><input type='text' class='code' id='code_<?php echo $position; ?>_<?php echo $scale_id; ?>' name='code_<?php echo $position; ?>_<?php echo $scale_id; ?>' value="<?php echo $row['code']; ?>" maxlength='5' size='5'
Expand Down
4 changes: 2 additions & 2 deletions scripts/admin/answers.js
Expand Up @@ -60,7 +60,7 @@ function deleteinput()

// 1.) Check if there is at least one answe

countanswers=$(this).parent().parent().parent().children().length;
countanswers=$(this).closest("tbody").children("tr").length;//Maybe use class is better
if (countanswers>1)
{
// 2.) Remove the table row
Expand Down Expand Up @@ -219,7 +219,7 @@ function updaterowproperties()
var rownumber=1;
$(this).children('tr').each(function(){

$(this).removeClass();
$(this).attr('class','');//see http://bugs.jqueryui.com/ticket/9015
if (highlight){
$(this).addClass('highlight');
}
Expand Down

0 comments on commit 0b575e7

Please sign in to comment.