Changeset 1884:0f968de01eb6 for plugins
- Timestamp:
- 08/20/13 00:51:23 (12 years ago)
- Branch:
- Ticket #1181
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/list.js
r1882 r1884 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 && 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 && 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 99 120 $(function() { 100 121 101 $('# form-entries tr.line').prepend('<td></td>');122 $('#pageslist tr.line').prepend('<td class="expander"></td>'); 102 123 $('#form-entries tr:not(.line) th:first').attr('colspan',4); 103 124 $('#form-entries tr:not(.line)').each(function() { 104 125 dotclear.postsExpander(this,$('#form-entries tr.line')); 105 126 }); 106 $('# form-entriestr.line').each(function() {127 $('#pageslist tr.line').each(function() { 107 128 dotclear.postExpander(this); 108 129 }); … … 112 133 dotclear.checkboxesHelpers(p); 113 134 }); 114 $('#form-entries td input[type=checkbox]').enableShiftClick(); 135 $('#pageslist td input[type=checkbox]').enableShiftClick(); 136 137 $("#pageslist tr.line td:not(.expander)").mousedown(function(){ 138 $('#pageslist tr.line').each(function() { 139 var td = this.firstChild; 140 dotclear.viewPostContent(td.firstChild,td.firstChild.line,'close'); 141 }); 142 $('#pageslist tr:not(.line)').remove(); 143 }); 115 144 116 145 $("#pageslist").sortable({ 117 146 cursor:'move', 118 start: function( event, ui ) {119 // todo refermer les post ouverts120 },121 147 stop: function( event, ui ) { 122 148 $("#pageslist tr td input.position").each(function(i) {
Note: See TracChangeset
for help on using the changeset viewer.