web/data/cubicweb.lazy.js
branchstable
changeset 5994 97c55baefa0c
parent 5658 7b9553a9db65
child 6952 7de13eb473e3
equal deleted inserted replaced
5976:00b1b6b906cf 5994:97c55baefa0c
     1 
       
     2 function load_now(eltsel, holesel, reloadable) {
     1 function load_now(eltsel, holesel, reloadable) {
     3     var lazydiv = jQuery(eltsel);
     2     var lazydiv = jQuery(eltsel);
     4     var hole = lazydiv.children(holesel);
     3     var hole = lazydiv.children(holesel);
     5     if ((hole.length == 0) && !reloadable) {
     4     if ((hole.length == 0) && ! reloadable) {
     6 	/* the hole is already filled */
     5         /* the hole is already filled */
     7 	return;
     6         return;
     8     }
     7     }
     9     lazydiv.loadxhtml(lazydiv.attr('cubicweb:loadurl'));
     8     lazydiv.loadxhtml(lazydiv.attr('cubicweb:loadurl'));
    10 }
     9 }
    11 
    10 
    12 function trigger_load(divid) {
    11 function trigger_load(divid) {
    13     jQuery('#lazy-' + divid).trigger('load_' + divid);
    12     jQuery('#lazy-' + divid).trigger('load_' + divid);
    14 }
    13 }
       
    14