Changeset 2531:2daf216ff255 for plugins
- Timestamp:
- 11/09/13 11:40:06 (12 years ago)
- Branch:
- 2.6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/list.js
r2527 r2531 1 dotclear.postExpander = function(line) {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.viewPostContent(line);6 e.preventDefault();7 })8 .prependTo($(line).children().get(0)); // first td9 };10 11 dotclear.postsExpander = function(line,lines) {12 $('<a href="#"><img src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/></a>')13 .click(function(e) {14 dotclear.toggleArrow(this);15 lines.each(function() {16 var action = dotclear.toggleArrow(this.firstChild.firstChild);17 dotclear.viewPostContent(this,action);18 });19 e.preventDefault();20 })21 .prependTo($(line).children().get(0)); // first td22 };23 24 dotclear.toggleArrow = function(link,action) {25 action = action || '';26 var img = $(link).children().get(0);27 if (action=='') {28 if (img.alt==dotclear.img_plus_alt) {29 action = 'open';30 } else {31 action = 'close';32 }33 }34 35 if (action=='open') {36 img.src = dotclear.img_minus_src;37 img.alt = dotclear.img_minus_alt;38 } else {39 img.src = dotclear.img_plus_src;40 img.alt = dotclear.img_plus_alt;41 }42 43 return action;44 }45 46 1 dotclear.viewPostContent = function(line,action) { 47 2 var action = action || 'toggle'; … … 91 46 $(line).removeClass('expand'); 92 47 } 93 94 parentTable = $(line).parents('table');95 if( parentTable.find('tr.expand').length == parentTable.find('tr.line').length ) {96 img = parentTable.find('tr:not(.line) th:first img');97 }98 99 if( parentTable.find('tr.expand').length == 0 ) {100 img = parentTable.find('tr:not(.line) th:first img');101 }102 103 48 }; 104 49 105 50 $(function() { 106 107 51 $('#pageslist tr.line').prepend('<td class="expander"></td>'); 108 52 $('#form-entries tr:not(.line) th:first').attr('colspan',4); 109 $('#form-entries tr:not(.line)').each(function() { 110 dotclear.postsExpander(this,$('#form-entries tr.line')); 111 }); 112 $('#pageslist tr.line').each(function() { 113 dotclear.postExpander(this); 53 $.expandContent({ 54 line:$('#form-entries tr:not(.line)'), 55 lines:$('#form-entries tr.line'), 56 callback:dotclear.viewPostContent 114 57 }); 115 58 $('.checkboxes-helpers').each(function() {
Note: See TracChangeset
for help on using the changeset viewer.