Changes in [1643:09fe8eaa4cf3:1608:13dcf46970b2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_posts_list.js
r1640 r1034 28 28 29 29 dotclear.viewPostsContent = function(img,lines) { 30 31 action = 'toggle'; 30 lines.each(function() { 31 var td = this.firstChild; 32 td.firstChild.click(); 33 }); 32 34 33 35 if (img.alt == dotclear.img_plus_alt) { 34 36 img.src = dotclear.img_minus_src; 35 37 img.alt = dotclear.img_minus_alt; 36 action = 'open';37 38 } else { 38 39 img.src = dotclear.img_plus_src; 39 40 img.alt = dotclear.img_plus_alt; 40 action = 'close';41 41 } 42 43 lines.each(function() {44 var td = this.firstChild;45 dotclear.viewPostContent(td.firstChild,td.firstChild.line,action);46 });47 42 }; 48 43 49 dotclear.viewPostContent = function(img,line,action) { 50 51 var action = action || 'toggle'; 44 dotclear.viewPostContent = function(img,line) { 52 45 var postId = line.id.substr(1); 53 46 var tr = document.getElementById('pe'+postId); 54 47 55 if ( !tr && ( action == 'toggle' || action == 'open' )) {48 if (!tr) { 56 49 tr = document.createElement('tr'); 57 50 tr.id = 'pe'+postId; … … 85 78 }); 86 79 87 $(line). addClass('expand');80 $(line).toggleClass('expand'); 88 81 line.parentNode.insertBefore(tr,line.nextSibling); 89 82 } 90 else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ))83 else if (tr.style.display == 'none') 91 84 { 92 $(tr). css('display', 'table-row');93 $(line). addClass('expand');85 $(tr).toggle(); 86 $(line).toggleClass('expand'); 94 87 img.src = dotclear.img_minus_src; 95 88 img.alt = dotclear.img_minus_alt; 96 89 } 97 else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) )90 else 98 91 { 99 $(tr). css('display', 'none');100 $(line). removeClass('expand');92 $(tr).toggle(); 93 $(line).toggleClass('expand'); 101 94 img.src = dotclear.img_plus_src; 102 95 img.alt = dotclear.img_plus_alt; 103 96 } 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 118 97 }; 119 98
Note: See TracChangeset
for help on using the changeset viewer.