Changeset 2527:52b330f07bd8 for admin/js/_post.js
- Timestamp:
- 11/08/13 16:54:05 (12 years ago)
- Branch:
- 2.6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r2109 r2527 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(e) { 4 dotclear.toggleArrow(this); 5 dotclear.viewCommentContent(line); 6 e.preventDefault(); 7 }) 8 .prependTo($(line).children().get(0)); // first td 13 9 }; 14 10 15 dotclear.viewCommentContent = function(img,line) { 16 var commentId = line.id.substr(1); 17 11 dotclear.toggleArrow = function(link,action) { 12 action = action || ''; 13 var img = $(link).children().get(0); 14 if (action=='') { 15 if (img.alt==dotclear.img_plus_alt) { 16 action = 'open'; 17 } else { 18 action = 'close'; 19 } 20 } 21 22 if (action=='open') { 23 img.src = dotclear.img_minus_src; 24 img.alt = dotclear.img_minus_alt; 25 } else { 26 img.src = dotclear.img_plus_src; 27 img.alt = dotclear.img_plus_alt; 28 } 29 30 return action; 31 } 32 33 dotclear.viewCommentContent = function(line,action) { 34 var commentId = $(line).attr('id').substr(1); 18 35 var tr = document.getElementById('ce'+commentId); 19 36 … … 25 42 td.className = 'expand'; 26 43 tr.appendChild(td); 27 28 img.src = dotclear.img_minus_src;29 img.alt = dotclear.img_minus_alt;30 44 31 45 // Get comment content … … 60 74 $(tr).toggle(); 61 75 $(line).toggleClass('expand'); 62 img.src = dotclear.img_minus_src;63 img.alt = dotclear.img_minus_alt;64 76 } 65 77 else … … 67 79 $(tr).toggle(); 68 80 $(line).toggleClass('expand'); 69 img.src = dotclear.img_plus_src;70 img.alt = dotclear.img_plus_alt;71 81 } 72 82 };
Note: See TracChangeset
for help on using the changeset viewer.