I have another example of this. I'm rewriting the calendar stuff (not ready to comment yet)
The existing code in SVN is broken in various ways, but in template_edit_holiday() (in ManageCalendar.template.php), you'll see some inline JS.
Replace it with:
Code: [Select]
Switch months, to something like February. Boom, no scrollbar. Sorry about the code, but it's late, and I'm very fed up this evening, since every little thing seems to take 4 times longer to follow it all down the respective rabbit holes. (Oh, and the old code doesn't work because the old method of pushing new Options doesn't work for some reason.)
The existing code in SVN is broken in various ways, but in template_edit_holiday() (in ManageCalendar.template.php), you'll see some inline JS.
Replace it with:
add_js('
var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function generateDays()
{
var days = 0, selected = 0, dayElement = $("#day"), year = $("#year").val(), monthElement = $("#month")[0];
monthLength[1] = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28;
selected = dayElement.val();
dayElement.empty();
days = monthLength[monthElement.value - 1];
for (i = 1; i <= days; i++)
dayElement.append(\'<option value="\' + i + \'">\' + i + \'</option>\');
if (selected < days)
dayElement.val(selected);
$("#day").sb();
}');Switch months, to something like February. Boom, no scrollbar. Sorry about the code, but it's late, and I'm very fed up this evening, since every little thing seems to take 4 times longer to follow it all down the respective rabbit holes. (Oh, and the old code doesn't work because the old method of pushing new Options doesn't work for some reason.)
This topic was marked solved by its starter, on March 16th, 2013, 01:40 AM




