Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish event works only on page load #20

Open
ktadikamalla opened this issue Jan 3, 2013 · 3 comments
Open

publish event works only on page load #20

ktadikamalla opened this issue Jan 3, 2013 · 3 comments

Comments

@ktadikamalla
Copy link

If we publish any notification based on some click event then that event is not sub scribed. if you invoke the below method based on some button click event then it does not perform the actions in subscribe event.

$("#testPlugin").testSubscribe().trigger("eventPublished");

But if we perform the below step on page load then it works.

$("#testPlugin").testSubscribe();
$("#testPlugin").testSubscribe().trigger("eventPublished");

@yckart
Copy link
Contributor

yckart commented Jan 4, 2013

That is the standard procedure: Initialize the plugin >> work with it...

@ktadikamalla
Copy link
Author

Hi,
it is really rare that we publish any notifications on ready event, most of the notifications would be on any events like button click or text box leave events, if we are not able to initialize plugin and publish notifications on events like button click I am trying to understand the work flow for this plugin what are the scenarios we can use this plugin just on ready event at the time of page load?

@addyosmani
Copy link
Member

This is true (re: notifications being broadcast on interactions with the page). I need to re-check this pattern but the publish events should be possible even after the plugin has been initialized to be really useful. Perhaps we need to consider simplifying this down a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants