From: Felix Nagel Date: Wed, 2 Dec 2015 17:44:20 +0000 (+0100) Subject: Calendar: Update Button widget implementation to latest changes X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d3bdde5f194ece2f17e178a7b49397a65ae0a97;p=jquery-ui.git Calendar: Update Button widget implementation to latest changes --- diff --git a/ui/widgets/calendar.js b/ui/widgets/calendar.js index c056a9ac2..f50a2aa0f 100644 --- a/ui/widgets/calendar.js +++ b/ui/widgets/calendar.js @@ -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; + $( "", 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 );