AddToCalendar / addtocalendar

Free customizable JavaScript widget "Add to Calendar" for event page. It allows users to easily schedule the event in their calendar. Learn more: https://addtocalendar.com
87 stars 43 forks source link

Fix for npm use #11

Closed truongnguyen1912 closed 8 years ago

truongnguyen1912 commented 8 years ago

When I use it with npm, it show some errors.

akrohn commented 8 years ago

Hey there,

shouldn't the fix for the addtocalendar.load(); is not a function problem not be to remove the ready part? I think this is only for JQuery and I'm sure this plugin is not specially for JQuery, but for Javascript. Changing the line: addtocalendar.load = ready(function () { to: addtocalendar.load = function () {

And changing:

    });
    addtocalendar.load();

to:

    };
    addtocalendar.load();

fixes the problem.

Hope this helps.

truongnguyen1912 commented 8 years ago

Do you miss something? I don't remove the ready part. I just call it.

akrohn commented 8 years ago

The load-function is useful to call it from the outside to initialize the plugin.

I think the problem is the "ready", which is JQuery functionality and this plugin has no dependency for JQuery, it's just a plain javascript plugin.

atc-master commented 8 years ago

Thank you for pull request! But @akrohn rights, "The load-function is useful to call it from the outside to initialize the plugin.".