Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion jquery.mobile.datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@
return this._super();
},
_create:function(){
var calendar, interval,
var calendar, interval, tempDiv
that = this;

$.each([ 'onSelect', 'onChangeMonthYear', 'beforeShow' ], function(key, val){
that.options[ '_'+val ] = that.options[ val ];
that.options[ val ] = function(){
if (that.tempDiv!=undefined) {
that.tempDiv.remove();
that.calendar.hide();
that.element.parent().after(that.tempDiv);
}
var args = arguments;
if (val == 'onSelect') {
that.element.trigger( "change" );
Expand All @@ -81,6 +86,9 @@

this.calendar = calendar;

this.tempDiv = this.calendar.clone();
this.tempDiv.removeAttr("id");

this.baseWidget = ( !this.options.inline )? this.element: this.calendar;

this._on({
Expand Down Expand Up @@ -136,6 +144,12 @@
.find(".ui-datepicker-calendar td" ).addClass("ui-body-"+this.options.theme).end()
.find(".ui-datepicker-calendar a.ui-state-active").addClass("ui-btn-active").end()
.find(".ui-datepicker-calendar a.ui-state-highlight").addClass("ui-btn-up-"+this.options.theme).end().find(".ui-state-disabled").css("opacity","1");
if (this.tempDiv!=undefined) {
this.tempDiv.hide();
this.calendar.show();
this.tempDiv = this.calendar.clone();
this.tempDiv.removeAttr("id");
}
}
});

Expand Down