web/data/cubicweb.lazy.js
author Julien Jehannet <julien.jehannet@logilab.fr>
Wed, 28 Apr 2010 16:13:56 +0200
changeset 5430 ed8f71e244f8
parent 559 7cfd3d11edc8
child 5658 7b9553a9db65
permissions -rw-r--r--
[shell] #715938: support of script parameters (using standard '--' as arguments separator) Arguments after bare "--" string will not be processed by the shell command You can use it to pass extra arguments to your script and expect for them in 'scriptargs' afterwards.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
485
0f830732be19 [tabs] provide a working tabs implementation, that lazy-loads tab content & should remember the current position
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     1
559
7cfd3d11edc8 [tabs] prepare for reloadability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 543
diff changeset
     2
function load_now(eltsel, holesel, reloadable) {
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     3
    var lazydiv = jQuery(eltsel);
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     4
    var hole = lazydiv.children(holesel);
559
7cfd3d11edc8 [tabs] prepare for reloadability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 543
diff changeset
     5
    if ((hole.length == 0) && !reloadable) {
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     6
	/* the hole is already filled */
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     7
	return;
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     8
    }
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     9
    lazydiv.loadxhtml(lazydiv.attr('cubicweb:loadurl'));
485
0f830732be19 [tabs] provide a working tabs implementation, that lazy-loads tab content & should remember the current position
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
    10
}
0f830732be19 [tabs] provide a working tabs implementation, that lazy-loads tab content & should remember the current position
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
    11
0f830732be19 [tabs] provide a working tabs implementation, that lazy-loads tab content & should remember the current position
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
    12
function trigger_load(divid) {
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
    13
    jQuery('#lazy-' + divid).trigger('load_' + divid);
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
    14
}