Changeset 2526:a96260306d4e
- Timestamp:
- 11/08/13 16:41:47 (12 years ago)
- Branch:
- 2.6
- Location:
- admin/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_comments.js
r1049 r2526 1 1 dotclear.commentExpander = function(line) { 2 var td = line.firstChild; 3 4 var img = document.createElement('img'); 5 img.src = dotclear.img_plus_src; 6 img.alt = dotclear.img_plus_alt; 7 img.className = 'expand'; 8 $(img).css('cursor','pointer'); 9 img.line = line; 10 img.onclick = function() { dotclear.viewCommentContent(this,this.line); }; 11 12 td.insertBefore(img,td.firstChild); 2 $('<a href="#"><img src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/></a>') 3 .click(function() { 4 dotclear.toggleArrow(this); 5 dotclear.viewCommentContent(line); 6 }) 7 .prependTo($(line).children().get(0)); // first td 13 8 }; 14 9 15 10 dotclear.commentsExpander = function(line,lines) { 16 var td = line.firstChild; 17 18 var img = document.createElement('img'); 19 img.src = dotclear.img_plus_src; 20 img.alt = dotclear.img_plus_alt; 21 img.className = 'expand'; 22 $(img).css('cursor','pointer'); 23 img.lines = lines; 24 img.onclick = function() { dotclear.viewCommentsContent(this,this.lines); }; 25 26 td.insertBefore(img,td.firstChild); 11 $('<a href="#"><img src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/></a>') 12 .click(function() { 13 dotclear.toggleArrow(this); 14 lines.each(function() { 15 var action = dotclear.toggleArrow(this.firstChild.firstChild); 16 dotclear.viewCommentContent(this,action); 17 }); 18 }) 19 .prependTo($(line).children().get(0)); // first td 27 20 }; 28 21 29 dotclear.viewCommentsContent = function(img,lines) { 30 lines.each(function() { 31 var td = this.firstChild; 32 td.firstChild.click(); 33 }); 22 dotclear.toggleArrow = function(link,action) { 23 action = action || ''; 24 var img = $(link).children().get(0); 25 if (action=='') { 26 if (img.alt==dotclear.img_plus_alt) { 27 action = 'open'; 28 } else { 29 action = 'close'; 30 } 31 } 34 32 35 if ( img.alt == dotclear.img_plus_alt) {33 if (action=='open') { 36 34 img.src = dotclear.img_minus_src; 37 35 img.alt = dotclear.img_minus_alt; … … 40 38 img.alt = dotclear.img_plus_alt; 41 39 } 42 };43 40 44 dotclear.viewCommentContent = function(img,line) { 45 var commentId = line.id.substr(1); 46 41 return action; 42 } 43 44 dotclear.viewCommentContent = function(line,action) { 45 var commentId = $(line).attr('id').substr(1); 47 46 var tr = document.getElementById('ce'+commentId); 48 47 … … 54 53 td.className = 'expand'; 55 54 tr.appendChild(td); 56 57 img.src = dotclear.img_minus_src;58 img.alt = dotclear.img_minus_alt;59 55 60 56 // Get comment content … … 91 87 $(tr).toggle(); 92 88 $(line).toggleClass('expand'); 93 img.src = dotclear.img_minus_src;94 img.alt = dotclear.img_minus_alt;95 89 } 96 90 else … … 98 92 $(tr).toggle(); 99 93 $(line).toggleClass('expand'); 100 img.src = dotclear.img_plus_src;101 img.alt = dotclear.img_plus_alt;102 94 } 103 95 }; -
admin/js/_posts_list.js
r2525 r2526 11 11 $('<a href="#"><img src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/></a>') 12 12 .click(function() { 13 var action =dotclear.toggleArrow(this);13 dotclear.toggleArrow(this); 14 14 lines.each(function() { 15 dotclear.toggleArrow(this.firstChild.firstChild,action);15 var action = dotclear.toggleArrow(this.firstChild.firstChild); 16 16 dotclear.viewPostContent(this,action); 17 17 });
Note: See TracChangeset
for help on using the changeset viewer.