Successful route notification?
I would like to be notified when a routing was successful. I tried "afterShow" but I assume that I am not using it properly because I cannot seem to catch the event:
pager.page.afterShow = function(){ console.log('after show'); // Do some other things... }
Any ideas? Thanks
Hm... strange. I dont remember if afterShow trigger on the global pager object or only on page objects at the moment. I guess there should be a navigationSuccess callback/event too that triggers whenever navigationFailed doesnt trigger. Some events on pager are $.Callbacks() and some are ko.observables (will be converted to $.Callbacks() ). Maybe you need
pager.afterShow.add(...)
Sent from my iPhone
On Mar 11, 2013, at 11:40, kokujin [email protected] wrote:
I would like to be notified when a routing was successful. I tried "afterShow" but I assume that I am not using it properly because I cannot seem to catch the event:
pager.page.afterShow = function(){ console.log('after show'); // Do some other things... }
Any ideas? Thanks
— Reply to this email directly or view it on GitHub.
hmm.. strange, its not declared as a function in the source...pager.afterShow does not exist
Just want to make sure this issue is fixed before I close it. OK?
As for the source it's declared in a loop:
$.each(['onBindingError', 'onSourceError', 'onNoMatch', 'onMatch',
'beforeRemove', 'afterRemove',
'beforeHide', 'afterHide',
'beforeShow', 'afterShow'], function (i, n) {
pager[n] = $.Callbacks();
});
in order to save some bytes (I'm trying to keep pagerjs under 5kb minified and gzipped).