knockout.js - jerky transition in Durandal -


i'm facing strange issue. i've set multiple routes hit same view/viewmodel, filtered differently. e.g.:

       router.mapnav('main/upcoming', 'viewmodels/items');        router.mapnav('main/all', 'viewmodels/items');        router.mapnav('main/archived', 'viewmodels/items'); 

the routing works fine , in vm activate function doing filtering display appropriate items:

function activate(r) {     switch (r.routeinfo.url) {         case 'main/upcoming': vm.filtertype(1); break;         case 'main/all': vm.filtertype(2); break;         case 'main/archived': vm.filtertype(3); break;     }     return init(); } 

finally, in same vm, have events when tabs clicked (upcoming, all, archived), toggle between views:

function toggleupcoming() {     //vm.filtertype(1);     router.navigateto('#/main/upcoming'); }  function toggleall() {     //vm.filtertype(2);     router.navigateto('#/main/all'); }  function togglearchived() {     //vm.filtertype(3);     router.navigateto('#/main/archived'); } 

the init() function waits on multiple promises finish before allowing activate function return.

this works, when click on tab, view loads, transition happens , view loads again, resulting in jerky effect. ideas?


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -