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

Changing bind to live, so that dynamic generated components can also generate events #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/jquery.evently.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,23 @@ function $$(node) {
}
var f = evfun(h, name);
if (typeof f == "function") {
elem.bind(name, {args:args}, f);
elem.live(name, {args:args}, f);
} else if (typeof f == "string") {
// just trigger another event
elem.bind(name, {args:args}, function(e) {
elem.live(name, {args:args}, function(e) {
$(this).trigger(f);
return false;
});
} else {
// an evently widget
elem.bind(name, {args:args}, function() {
elem.live(name, {args:args}, function() {
react($(this), h, arguments);
return false;
});
}
// should be a plugin
// if ($.evently.log) {
// elem.bind(name, function() {$.log(elem, name)});
// elem.live(name, function() {$.log(elem, name)});
// }
// todo make pathbinder plugin
// if (h.path) {
Expand Down Expand Up @@ -213,7 +213,7 @@ function $$(node) {
$.evently = {
connect : function(source, target, events) {
events.forEach(function(ev) {
$(source).bind(ev, function() {
$(source).live(ev, function() {
var args = $.makeArray(arguments)
, e1 = args.shift();
args.push(e1);
Expand Down