web/data/cubicweb.preferences.js
author sylvain.thenault@logilab.fr
Wed, 22 Apr 2009 16:50:46 +0200
branchtls-sprint
changeset 1419 7ff24154351d
parent 604 e85042d18b48
child 1641 2c80b09d8d86
permissions -rw-r--r--
javascript + json refactoring
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
604
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     1
/* toggle visibility of an element by its id
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     2
 * & set current visibility status in a cookie
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     3
 * XXX whenever used outside of preferences, don't forget to
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     4
 *     move me in a more appropriate place
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     5
 */
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     6
function toggle_and_remember_visibility(elemId, cookiename) {
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     7
    jqNode(elemId).toggleClass('hidden');
1419
7ff24154351d javascript + json refactoring
sylvain.thenault@logilab.fr
parents: 604
diff changeset
     8
    asyncRemoteExec('set_cookie', cookiename,
604
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
     9
                      jQuery('#' + elemId).attr('class'));
e85042d18b48 [preferences] preferences sections will now remember their collapsed/open status
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff changeset
    10
}