tardate / jquery.addtocalendar

jQuery UI widget that provides "Add to Calendar" functionality. Supports an extensible range of calendar services - desktop and web-based
MIT License
93 stars 35 forks source link

Doesn't work with jQuery UI 1.9.0+ #11

Open MikeKingery opened 11 years ago

MikeKingery commented 11 years ago

When I updated jQuery UI to version 1.9.0 or higher I start getting the following error:

cannot call methods on AddToCal prior to initialization; attempted to call method 'close'

This stems from the following call within toggleMenu:

$('.ui-addtocal').AddToCal( 'close' );

tardate commented 11 years ago

Hi Mike,

Thanks for looking into this. I need all the help I can get to keep this maintained;-)

To be honest, I am moving away from jQuery UI wherever possible and not using on new projects. So I'm wondering if rather than make it jQuery UI 1.9 compatible, would it be best to refactor this completely to remove the jQueryUI dependency?

MikeKingery commented 11 years ago

I haven't done much plugin development with jQuery UI so I'll go with whatever is your suggestion.

xgretsch commented 10 years ago

Removing dependency on jQuery UI is a good idea, because the download is very large (can be 200 kbytes plus). Currently trying to use this and falling foul of this problem - is there a known workaround?

ksburrell commented 9 years ago

I made this work wtih 1.9 by making the following changes in jquery.addtocal.js:

  1. Changed "selected" event to "select" when intializing the menu widget in _create().
  2. Changed "deactivate" calls to "collapse" on the menu property
  3. Changed $('.ui-addtocal').AddToCal('close') to $('.ui-addtocal').find('input').AddToCal('close');
tardate commented 9 years ago

@cincobyte good stuff. If you can send a pull request with your changes, I'm happy to roll them in.

ghost commented 7 years ago

Hi, We have updated the jquery to 1.9.1 and jqueryui to 1.11.3 and getting below issues: Error : this.menu.'element' is undefined at t.(anonymous function).(anonymous function).toggleMenu Please help and suggest a workaround. Thanks, Chandra