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