themes/enanium/js/inlinerename.js
changeset 958 3dafe0969e5a
parent 955 de4f81abc5e3
child 1300 1f97ee3ec614
equal deleted inserted replaced
957:6b7644fec887 958:3dafe0969e5a
     1 // Sidebar collapse
     1 // Sidebar collapse
     2 function enanium_toggle_sidebar_right()
     2 function enanium_toggle_sidebar(side)
     3 {
     3 {
     4   if ( document.getElementById('enanium_sidebar_right').style.display == 'none' )
     4   if ( document.getElementById('enanium_sidebar_' + side).style.display == 'none' )
     5   {
     5   {
     6     // show
     6     // show
     7     document.getElementById('enanium_sidebar_right').style.display = 'block';
     7     document.getElementById('enanium_sidebar_' + side).style.display = 'block';
     8     document.getElementById('enanium_sidebar_right_hidden').style.display = 'none';
     8     document.getElementById('enanium_sidebar_' + side + '_hidden').style.display = 'none';
     9     createCookie('right_sidebar', 'open', 365);
     9     createCookie(side + '_sidebar', 'open', 365);
    10   }
    10   }
    11   else
    11   else
    12   {
    12   {
    13     // hide
    13     // hide
    14     document.getElementById('enanium_sidebar_right').style.display = 'none';
    14     document.getElementById('enanium_sidebar_' + side).style.display = 'none';
    15     document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
    15     document.getElementById('enanium_sidebar_' + side + '_hidden').style.display = 'block';
    16     createCookie('right_sidebar', 'collapsed', 365);
    16     createCookie(side + '_sidebar', 'collapsed', 365);
    17   }
    17   }
       
    18 }
       
    19 
       
    20 function enanium_toggle_sidebar_right()
       
    21 {
       
    22   enanium_toggle_sidebar('right');
       
    23 }
       
    24 
       
    25 function enanium_toggle_sidebar_left()
       
    26 {
       
    27   enanium_toggle_sidebar('left');
    18 }
    28 }
    19 
    29 
    20 addOnloadHook(function()
    30 addOnloadHook(function()
    21   {
    31   {
       
    32     if ( readCookie('left_sidebar') == 'collapsed' )
       
    33     {
       
    34       document.getElementById('enanium_sidebar_left').style.display = 'none';
       
    35       document.getElementById('enanium_sidebar_left_hidden').style.display = 'block';
       
    36     }
       
    37     
    22     if ( readCookie('right_sidebar') == 'collapsed' )
    38     if ( readCookie('right_sidebar') == 'collapsed' )
    23     {
    39     {
    24       document.getElementById('enanium_sidebar_right').style.display = 'none';
    40       document.getElementById('enanium_sidebar_right').style.display = 'none';
    25       document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
    41       document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
    26     }
    42     }