yeelliott / jquery-utils

Automatically exported from code.google.com/p/jquery-utils
MIT License
0 stars 0 forks source link

patch to add the buttonImage functionality of datepicker #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
not the right place to put it in, but the faster. tested with FF
in diff format:

1083,1085c1083,1087
<             this.element.bind(this.options.trigger +'.dropslide', function(){
<                 widget.show();
<             });

---
>             if (this.options.trigger != 'button') {
>                 this.element.bind(this.options.trigger +'.dropslide', 
function(){
>                     widget.show();
>                 });
>             }
1244a1247,1258
>             if (ui.options.buttonImage) { // pop-up date picker when button 
clicked
>                 var buttonText = this.options.buttonText;
>                 var buttonImage = this.options.buttonImage;
>                 button = $('<img/>').
>                         attr({ src: buttonImage, alt: buttonText, title: 
buttonText });
> 
>                 button.click(function() {
>                     $(element).dropslide('show');
>                 });
>                 $(menu).after(button);
>             }
> 
1409c1423,1425
<             val:         false

---
>             val:         false,
>             buttonText: '...', // Text for trigger button
>             buttonImage: '', // URL for trigger button image

Original issue reported on code.google.com by vo.s...@gmail.com on 27 Mar 2009 at 2:49

GoogleCodeExporter commented 9 years ago
has problems with safari 3.2.1
when you click the last element (minutes) the menu remains open

Original comment by vo.s...@gmail.com on 27 Mar 2009 at 2:53

GoogleCodeExporter commented 9 years ago
how to try it:
.timepickr( { buttonImage: '/m/calendar.gif', dropslide: {trigger: 'button'}  } 
);

Original comment by vo.s...@gmail.com on 27 Mar 2009 at 2:57

GoogleCodeExporter commented 9 years ago
fixed by changing this (line 1253):
                button.click(function() {
                    $(element).dropslide('show');
                });

into this:
                button.click(function() {
                    $(element).focus();
                    $(element).dropslide('show');
                });

Original comment by vo.s...@gmail.com on 27 Mar 2009 at 3:03

GoogleCodeExporter commented 9 years ago
Thanks a lot for the contribution, but the timepickr plugin provide an option 
called
"handle" which was designed specifically for this purpose.

However it doesn't take care the image tag creation, just like it doesn't take 
care
of creating the input.

The proper way would be to insert your image next to the input in your HTML 
file and
pass the image's id as handle argument to the timepickr;

$('#timepickr').timepickr({handle: '#myImageID'});

Regards

Original comment by hainea...@gmail.com on 6 Aug 2009 at 5:57