Skip to content

Commit

Permalink
Dev: some fix for duplicate id in label set editor with more than one…
Browse files Browse the repository at this point in the history
… lang

Dev: quickadd is broken (before that patch too) : put a bug report
Dev: tested : remove, add, move order
  • Loading branch information
Shnoulle committed Dec 4, 2012
1 parent 17dcfc5 commit 3c97a63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions application/views/admin/labels/labelview_view.php
Expand Up @@ -53,7 +53,7 @@
$codeids = $codeids . ' ' . $row['sortorder'];
}
?>
<tr style='white-space: nowrap;' id='row<?php echo $row['sortorder'] ?>'<?php
<tr style='white-space: nowrap;' id='row_<?php echo $row['language']; ?>_<?php echo $row['sortorder'] ?>'<?php
if ($alternate == true) {
?> class="highlight" <?php
}
Expand Down Expand Up @@ -86,17 +86,17 @@
echo getEditor("editlabel", "title_{$row['language']}_{$row['sortorder']}", "[" . $clang->gT("Label:", "js") . "](" . $row['language'] . ")", '', '', '', $action);
?>
</td>
<td style='text-align:center;'>
<?php
if ($first)
{
?>
<td style='text-align:center;'>
<img src='<?php echo $sImageURL; ?>addanswer.png' class='btnaddanswer' alt='<?php $clang->eT("Insert a new label after this one") ?>' />
<img src='<?php echo $sImageURL; ?>deleteanswer.png' class='btndelanswer' alt='<?php $clang->eT("Delete this label") ?>' />
</td>
<?php
}
?>
</td>
</tr>
<?php
$position++;
Expand All @@ -105,7 +105,7 @@
?>
</tbody>
</table>
<button class='btnquickadd' id='btnquickadd' type='button'><?php $clang->eT('Quick add...') ?></button>
<button class='btnquickadd' id='btnquickadd_<?php echo $i ?>' type='button'><?php $clang->eT('Quick add...') ?></button>
<p><input type='submit' name='method' value='<?php $clang->eT("Save changes") ?>' id='saveallbtn_<?php echo $lslanguage ?>' /></p>
</div>
<?php
Expand Down Expand Up @@ -161,4 +161,4 @@
<button id='btnqacancel' type='button'><?php $clang->eT('Cancel') ?></button>
</div>
</div>
</div>
</div>
5 changes: 3 additions & 2 deletions scripts/admin/labels.js
Expand Up @@ -62,7 +62,8 @@ $(document).ready(function(){
$("tbody>tr",$("#tabs>form>div:first")).each(function(trindex,trelement){

var tr_code = $(trelement).attr('id');
tr_code=tr_code.substr(3);
tr_code=tr_code.split('_');// first is row, second langage and last the rox
tr_code=tr_code[2];
dataToSend['codelist'].push(tr_code);
dataToSend[tr_code] = {
code: $("#code_"+tr_code).val(),
Expand Down Expand Up @@ -259,7 +260,7 @@ function createNewLabelTR(alternate,first){
x = "<tr ";
if (alternate)
x = x + "class= 'highlight' ";
x = x + "style = 'white-space: nowrap;' id='row###next###'>";
x = x + "style = 'white-space: nowrap;' id='row_###lang###_###next###'>";

if (!first)
x = x + "<td>###codeval###</td><td>###assessmentval###</td>";
Expand Down

0 comments on commit 3c97a63

Please sign in to comment.