Bug 13289: document.write breaks DataTables

The document.write in a td seems to brake the page with a new version of
DataTables.

This patch replaces a dirty piece of code with another one (but this one
works...)

Test plan:
Create repeatable holidays and verify the page loads correctly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Works to fix the problem. The code is definitely an improvement.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, fixes critical problem.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Jonathan Druart 2014-11-19 15:29:48 +01:00 committed by Tomas Cohen Arazi
parent 5aa40b90a7
commit c474b0f645

View file

@ -157,6 +157,10 @@
$("#branch").change(function(){
changeBranch();
});
$("#holidayweeklyrepeatable>tbody>tr").each(function(){
var first_td = $(this).find('td').first();
first_td.html(weekdays[first_td.html()]);
});
$("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"bPaginate": false
@ -463,10 +467,7 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl
<tbody>
[% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %]
<tr>
<td>
<script type="text/javascript">
document.write(weekdays[ [% WEEK_DAYS_LOO.KEY %]]);
</script>
<td>[% WEEK_DAYS_LOO.KEY %]</td>
</td>
<td>[% WEEK_DAYS_LOO.TITLE %]</td>
<td>[% WEEK_DAYS_LOO.DESCRIPTION %]</td>