Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : can.batch.start callback called too early in can.Map.extend() init?

$
0
0
This is using batch for something they are not designed to be used for.  A more correct, but difficult, approach would be to support pause / resume and default events. 

This way, you could mix in behavior to a remove event event that would first animate out the elements and then resume the default behavior of removing the elements. 

Furthermore, adding animations should be more View than View-Model. What I mean is that your approach adds extra view-model state to give the view what it needs to change the className property. Instead, the view should be powerful enough to mix in this behavior. It's already possible, but not well documented to add a custom attribute like:

can-fadeIn="X"

can-fadeOut="Y"

Where X and Y could be the classNames that are used to run those animations. 

2.1 will include documentation for how to do this. You can look at how can-value works but it's Scanner API will change. 

Sent from my iPhone

On Dec 22, 2013, at 9:39 PM, JavaScriptMVC Forum <noreply@zohodiscussions.com> wrote:


Viewing all articles
Browse latest Browse all 3491

Trending Articles