Calendar: Update Button widget implementation to latest changes

This commit is contained in:
Felix Nagel 2015-12-02 18:44:20 +01:00
parent c10ef0a170
commit 5d3bdde5f1

View File

@ -478,18 +478,23 @@ return $.widget( "ui.calendar", {
// Change the context for the click callback to be the main element
click = props.click;
props.click = function() {
click.apply( that.buttonClickContext, arguments );
};
buttonOptions = {
icons: props.icons,
text: props.showText
icon: props.icon,
iconPosition: props.iconPosition,
showLabel: props.showLabel
};
delete props.icons;
delete props.showText;
delete props.click;
delete props.icon;
delete props.iconPosition;
delete props.showLabel;
$( "<button></button>", props )
.button( buttonOptions )
.appendTo( that.buttonSet );
.appendTo( that.buttonSet )
.on( "click", function() {
click.apply( that.buttonClickContext, arguments );
} );
} );
this.element.addClass( "ui-calendar-buttons" );
this.buttonPane.appendTo( this.element );