includes/clientside/static/paginate.js
changeset 98 6457a9b983c6
parent 86 c162ca39db8f
equal deleted inserted replaced
97:293148ad7a70 98:6457a9b983c6
   191   var paginator = "\n"+begin+inner+end+"\n";
   191   var paginator = "\n"+begin+inner+end+"\n";
   192   return paginator;
   192   return paginator;
   193   
   193   
   194 }
   194 }
   195 
   195 
       
   196 var __paginateLock = false;
       
   197 
   196 function jspaginator_goto(pagin_id, jump_to)
   198 function jspaginator_goto(pagin_id, jump_to)
   197 {
   199 {
       
   200   if ( __paginateLock )
       
   201     return false;
   198   var theobj = pagin_objects[pagin_id];
   202   var theobj = pagin_objects[pagin_id];
   199   var current_div = false;
   203   var current_div = false;
   200   var new_div = false;
   204   var new_div = false;
   201   for ( var i = 0; i < theobj.num_pages; i++ )
   205   for ( var i = 0; i < theobj.num_pages; i++ )
   202   {
   206   {
   237     current_div.style.display = 'none';
   241     current_div.style.display = 'none';
   238     new_div.style.display = 'block';
   242     new_div.style.display = 'block';
   239   }
   243   }
   240   else
   244   else
   241   {
   245   {
       
   246     __paginateLock = true;
   242     var fade_time = 375;
   247     var fade_time = 375;
   243     var code = 'var old = \'' + current_div.id + '\';';
   248     var code = 'var old = \'' + current_div.id + '\';';
   244     code    += 'var newer = \'' + new_div.id + '\';';
   249     code    += 'var newer = \'' + new_div.id + '\';';
   245     code    += 'document.getElementById(old).style.display = "none";';
   250     code    += 'document.getElementById(old).style.display = "none";';
   246     code    += 'changeOpac(0, newer);';
   251     code    += 'changeOpac(0, newer);';
   247     code    += 'document.getElementById(newer).style.display = "block";';
   252     code    += 'document.getElementById(newer).style.display = "block";';
   248     code    += 'opacity(newer, 0, 100, '+fade_time+');';
   253     code    += 'opacity(newer, 0, 100, '+fade_time+');';
       
   254     code    += '__paginateLock = false;';
   249     // if ( window.console )
   255     // if ( window.console )
   250       // window.console.debug('metacode for fader: ', code);
   256       // window.console.debug('metacode for fader: ', code);
   251     opacity(current_div.id, 100, 0, fade_time);
   257     opacity(current_div.id, 100, 0, fade_time);
   252     setTimeout(code, (fade_time + 50));
   258     setTimeout(code, (fade_time + 50));
   253   }
   259   }