web/data/cubicweb.lazy.js
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 02 Jul 2010 15:26:59 +0200
changeset 5869 8a129b3a5aff
parent 5658 7b9553a9db65
child 6952 7de13eb473e3
permissions -rw-r--r--
reledit refactoring * js handling rewritten to exploit all form capabilities (such as file upload ...) * attribute-like composite relations (one ttype, cardinality in '?1' from composite side) are more cutely handled, with a 'add'/'delete' additional actions/icons * a reledit_ctrl rtag to finely control: reloading, edition and default values * a proper chapter in the documentation (book) * many bugfixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
559
7cfd3d11edc8 [tabs] prepare for reloadability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 543
diff changeset
     1
function load_now(eltsel, holesel, reloadable) {
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     2
    var lazydiv = jQuery(eltsel);
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     3
    var hole = lazydiv.children(holesel);
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 559
diff changeset
     4
    if ((hole.length == 0) && ! reloadable) {
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 559
diff changeset
     5
        /* the hole is already filled */
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 559
diff changeset
     6
        return;
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     7
    }
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
     8
    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
     9
}
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
function trigger_load(divid) {
543
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
    12
    jQuery('#lazy-' + divid).trigger('load_' + divid);
c0f2b6378f70 simplification of lazy tabs mechanism
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 522
diff changeset
    13
}
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 559
diff changeset
    14