Closed alextcl closed 10 years ago
Knockout has progressively moved in the direction that bindings don't update each other. So "runafter" needs a little extra help to get all the dependencies.
ko.bindingHandlers.runafter = {
update: function(element, valueAccessor, allBindingsAccessor) {
// add dependency on all other bindings
ko.toJS(allBindingsAccessor());
setTimeout(function() {
var value = valueAccessor();
if (typeof value != 'function' || ko.isObservable(value))
throw new Error('run must be used with a function');
value(element);
});
}
};
I've also updated https://github.com/knockout/knockout/wiki/Bindings:-runafter
Thanks for letting me know about this.
Hi, I was using your runafter bindinghandler,
the binding is working up to knockout version 2.1 http://jsfiddle.net/alextancl/W5KDE/1/
however, it break when using version 2.2 and above http://jsfiddle.net/alextancl/W5KDE/2/
could you please look into this