From 5d3bdde5f194ece2f17e178a7b49397a65ae0a97 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 2 Dec 2015 18:44:20 +0100 Subject: [PATCH] Calendar: Update Button widget implementation to latest changes --- ui/widgets/calendar.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 ); -- 2.39.5