Callback after item/items etc.

0 views
Skip to first unread message

Mathew Byrne

unread,
Oct 6, 2008, 2:14:06 AM10/6/08
to chainjs
The current implementation of chain.js can be slow at times depending
on what your doing. I'm developing an app at the moment and would like
to display a loading screen to a user every time chain.js binds data
from a large data set to some DOM elements.

I also want to prevent impatient users from clicking through the
interface if loading takes more than a second or so.

I think it would be a good idea to provide a method for registering
callback functions, perhaps an argument to .chain()?

An example of what I'm talking about:

var loading = false,
list = $('#gallery_list')
.chain({
...
}, function () {
loading = false;
});

$('#gallery').click(function () {
var self = $(this),
item = self.items();

if (loading) {
return;
}

loading = true;
$('#gallery_images').items(item.images);
});

Rizqi Ahmad

unread,
Oct 12, 2008, 4:12:39 PM10/12/08
to chainjs
sorry for the late answer, I was abroad.
I am already planning to implement it.
Reply all
Reply to author
Forward
0 new messages