Dotclear

Changeset 1034:b11afd216931 for admin/js


Ignore:
Timestamp:
11/25/12 11:57:12 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

A little bit more elegant code

Location:
admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_comments.js

    r1033 r1034  
    1313}; 
    1414 
    15 dotclear.commentsExpander = function(line) { 
     15dotclear.commentsExpander = function(line,lines) { 
    1616     var td = line.firstChild; 
    1717      
     
    2121     img.className = 'expand'; 
    2222     $(img).css('cursor','pointer'); 
    23      img.line = line; 
    24      img.onclick = function() { dotclear.viewCommentsContent(this,this.line); }; 
     23     img.lines = lines; 
     24     img.onclick = function() { dotclear.viewCommentsContent(this,this.lines); }; 
    2525      
    2626     td.insertBefore(img,td.firstChild); 
    2727}; 
    2828 
    29 dotclear.viewCommentsContent = function(img,line) { 
    30      $('#form-comments tr.line').each(function() { 
     29dotclear.viewCommentsContent = function(img,lines) { 
     30     lines.each(function() { 
    3131          var td = this.firstChild; 
    3232          td.firstChild.click(); 
     
    105105$(function() { 
    106106     $('#form-comments tr:not(.line)').each(function() { 
    107           dotclear.commentsExpander(this); 
     107          dotclear.commentsExpander(this,$('#form-comments tr.line')); 
    108108     }); 
    109109     $('#form-comments tr.line').each(function() { 
  • admin/js/_posts_list.js

    r1033 r1034  
    88     $(img).css('cursor','pointer'); 
    99     img.line = line; 
    10      img.onclick = function() { dotclear.viewPostContent(this,this.line); positionFooter(); }; 
     10     img.onclick = function() { dotclear.viewPostContent(this,this.line); }; 
    1111      
    1212     td.insertBefore(img,td.firstChild); 
    1313}; 
    1414 
    15 dotclear.postsExpander = function(line) { 
     15dotclear.postsExpander = function(line,lines) { 
    1616     var td = line.firstChild; 
    1717 
     
    2121     img.className = 'expand'; 
    2222     $(img).css('cursor','pointer'); 
    23      img.line = line; 
    24      img.onclick = function() { dotclear.viewPostsContent(this,this.line); }; 
     23     img.lines = lines; 
     24     img.onclick = function() { dotclear.viewPostsContent(this,this.lines); }; 
    2525 
    2626     td.insertBefore(img,td.firstChild); 
    2727}; 
    2828 
    29 dotclear.viewPostsContent = function(img,line) { 
    30      $('#form-entries tr.line').each(function() { 
     29dotclear.viewPostsContent = function(img,lines) { 
     30     lines.each(function() { 
    3131          var td = this.firstChild; 
    3232          td.firstChild.click(); 
     
    104104 
    105105     $('#form-entries tr:not(.line)').each(function() { 
    106           dotclear.postsExpander(this); 
     106          dotclear.postsExpander(this,$('#form-entries tr.line')); 
    107107     }); 
    108108     $('#form-entries tr.line').each(function() { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map