Opened 13 years ago

Closed 11 years ago

#4966 closed bug (worksforme)

after redirect in onSelect the datepicker collapses in Safari

Reported by: orange.x Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.7.2
Keywords: datepicker safari collapse Cc:
Blocked by: Blocking:

Description

I'm using the onSelect to redirect from the page to another page that uses the date to show me a newsmessage. It works just fine but when I go back ( via backspace ) the datepicker is collapsed. When I pay attention I can see that it already collapses just before the redirect is done. This problem only occurs in Safari 4.03 and the newest Safari. Firefox has nog problem with the collapsing.

Here you can see what it does: www.orangewebdesign.nl/sites/snijder/nieuws You have to use the big datepicker in the middle of the screen ( the one at the top does it also but the effect of the collapsing isn't clear on that datepicker ). The page will redirect to nieuws/2009-11-19 for example. When you go back it only shows the border of the datepicker.

Here's the code: $(document).ready(function(){

$("#nieuws_agenda").datepicker({

inline: true, defaultDate: activeDate, beforeShowDay: setScheduledDays, onSelect:

function(value, date) {

datum_parts = value.split('/'); alert(datum_parts[0]); redirect(value); alert('The url is: http://www.domein.nl/nieuws/' + value );

}

}).show();

});

and this is the code of the scheduledDays: function setScheduledDays(date) {

var isScheduled = false; var isHoliday = false; var scheduleStatus = ""; Check for scheduled day for (i = 0; i < scheduledDays.length; i++) {

if (date.getMonth() == scheduledDays[i][0] - 1 && date.getDate() == scheduledDays[i][1] && date.getFullYear() == scheduledDays[i][2]) {

isScheduled = true; scheduleStatus = scheduledDays[i][3];

}

} if (isScheduled) {

return [true, scheduleStatus];

} else {

return [false, ];

}

}

And the redirect function. I made it because it could solve my problem, but it didn't: function redirect($datum) {

window.location = "nieuws/" + $datum;

}

Change History (2)

comment:1 Changed 13 years ago by Scott González

Milestone: TBD1.8

comment:2 Changed 11 years ago by Jörn Zaefferer

Resolution: worksforme
Status: newclosed

Works fine in latest Safari. Had to click back to Januar 2010, click on one of the highlighted links. Going back showed the inline datepicker again.

Note: See TracTickets for help on using tickets.