]> source.dussan.org Git - jquery-ui.git/commitdiff
Calendar: Update Button widget implementation to latest changes
authorFelix Nagel <info@felixnagel.com>
Wed, 2 Dec 2015 17:44:20 +0000 (18:44 +0100)
committerFelix Nagel <info@felixnagel.com>
Wed, 2 Dec 2015 17:44:20 +0000 (18:44 +0100)
ui/widgets/calendar.js

index c056a9ac277cde142f65a3ab665f8f60dfe2be63..f50a2aa0f4a59f295a69fca38637faeb8f1b8641 100644 (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 );