Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions assets/archivedfilter.publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@

// Initial function: instantiates extension after verifying that the archive field exists
function initHide() {
table.find('thead th').each(function(index) {
$('table').find('thead th').each(function(index) {

var column = $(this);
var title = $.trim(column.text()).toLowerCase();

// Check name of field to see if it's an archive field.
// If your field happens to be named something different than 'Archived' or 'Archive', this is where you add it
if (title == 'archived' || title == 'archive') {
if (title == 'archived' || title == 'archive' || title == 'Archive') {
colindex = index+1;

var btn = $('<a class="button" id="archivecontrol"></a>');
$('#contents h2').append($(btn));
var btn = $('<li><a class="button" id="archivecontrol"></a></li>');
$('ul.actions').append($(btn));

hideItems();
}
}
});
}

Expand All @@ -39,7 +38,7 @@
showItems();
}).html('Show Archived');

table.find('tr td:nth-child('+colindex+')').each(function() {
$('table').find('tr td:nth-child('+colindex+')').each(function() {
var cell = $(this);
var text = $.trim(cell.text());
cell.addClass('hidden');
Expand Down
4 changes: 2 additions & 2 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Extension_Archivedfilter extends Extension {
/**
* Extension information
*/
public function about() {
/*public function about() {
return array(
'name' => 'Archived Filter',
'version' => '1.0',
Expand All @@ -17,7 +17,7 @@ public function about() {
),
'description' => 'Adds a toggle button to show/hide archived items.'
);
}
}*/

/**
* Add callback functions to backend delegates
Expand Down