Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_posts_list.js

    r1640 r1034  
    2828 
    2929dotclear.viewPostsContent = function(img,lines) { 
    30       
    31      action = 'toggle'; 
     30     lines.each(function() { 
     31          var td = this.firstChild; 
     32          td.firstChild.click(); 
     33     }); 
    3234 
    3335     if (img.alt == dotclear.img_plus_alt) { 
    3436          img.src = dotclear.img_minus_src; 
    3537          img.alt = dotclear.img_minus_alt; 
    36           action = 'open'; 
    3738     } else { 
    3839          img.src = dotclear.img_plus_src; 
    3940          img.alt = dotclear.img_plus_alt; 
    40           action = 'close'; 
    4141     } 
    42       
    43      lines.each(function() { 
    44           var td = this.firstChild; 
    45           dotclear.viewPostContent(td.firstChild,td.firstChild.line,action); 
    46      }); 
    4742}; 
    4843 
    49 dotclear.viewPostContent = function(img,line,action) { 
    50       
    51      var action = action || 'toggle'; 
     44dotclear.viewPostContent = function(img,line) { 
    5245     var postId = line.id.substr(1); 
    5346     var tr = document.getElementById('pe'+postId); 
    5447      
    55      if ( !tr && ( action == 'toggle' || action == 'open' ) ) { 
     48     if (!tr) { 
    5649          tr = document.createElement('tr'); 
    5750          tr.id = 'pe'+postId; 
     
    8578          }); 
    8679           
    87           $(line).addClass('expand'); 
     80          $(line).toggleClass('expand'); 
    8881          line.parentNode.insertBefore(tr,line.nextSibling); 
    8982     } 
    90      else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ) ) 
     83     else if (tr.style.display == 'none') 
    9184     { 
    92           $(tr).css('display', 'table-row'); 
    93           $(line).addClass('expand'); 
     85          $(tr).toggle(); 
     86          $(line).toggleClass('expand'); 
    9487          img.src = dotclear.img_minus_src; 
    9588          img.alt = dotclear.img_minus_alt; 
    9689     } 
    97      else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) ) 
     90     else 
    9891     { 
    99           $(tr).css('display', 'none'); 
    100           $(line).removeClass('expand'); 
     92          $(tr).toggle(); 
     93          $(line).toggleClass('expand'); 
    10194          img.src = dotclear.img_plus_src; 
    10295          img.alt = dotclear.img_plus_alt; 
    10396     } 
    104       
    105      parentTable = $(line).parents('table'); 
    106      if( parentTable.find('tr.expand').length == parentTable.find('tr.line').length ) { 
    107           img = parentTable.find('tr:not(.line) th:first img'); 
    108           img.attr('src',dotclear.img_minus_src); 
    109           img.attr('alt',dotclear.img_minus_alt); 
    110      } 
    111       
    112      if( parentTable.find('tr.expand').length == 0 ) { 
    113           img = parentTable.find('tr:not(.line) th:first img'); 
    114           img.attr('src',dotclear.img_plus_src); 
    115           img.attr('alt',dotclear.img_plus_alt); 
    116      } 
    117       
    11897}; 
    11998 
Note: See TracChangeset for help on using the changeset viewer.

Sites map