From af0e40806376ccda74891eb99fbda8c589fc766b Mon Sep 17 00:00:00 2001 From: Nigel McNie Date: Wed, 28 Mar 2007 15:54:52 +1200 Subject: [PATCH] Make the navigation for the file section display again. It was being hidden by the code that hides the emptycontent message, which was incorrectly hiding the wrong thing. Now the emptycontent is tracked internally by the tablerenderer so this won't happen again --- htdocs/js/tablerenderer.js | 22 ++++++++++++++-------- htdocs/lib/version.php | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/js/tablerenderer.js b/htdocs/js/tablerenderer.js index 5288b8cc..7fd87f48 100644 --- a/htdocs/js/tablerenderer.js +++ b/htdocs/js/tablerenderer.js @@ -13,7 +13,7 @@ function TableRenderer(target, source, columns, options) { this.paginate_simple = true; this.paginate_firstlast = true; this.statevars = ['offset','limit']; - this.emptycontent = false; // Something to display when no results are found + this.emptycontent = undefined; // Something to display when no results are found this.rowfunction = function(rowdata, rownumber, data) { return TR({'class': 'r' + (rownumber % 2)}); } this.updatecallback = function () {}; @@ -49,10 +49,10 @@ function TableRenderer(target, source, columns, options) { self.assertPager(self.offset, self.limit, self.count); } - if (self.emptycontent) { - var newelement = DIV(null,self.emptycontent); - hideElement(newelement); - insertSiblingNodesBefore(self.table, newelement); + if (typeof(self.emptycontent) != 'undefined') { + self.emptycontent = DIV(null,self.emptycontent); + addElementClass(self.emptycontent, 'hidden'); + insertSiblingNodesBefore(self.table, self.emptycontent); } }; @@ -179,14 +179,20 @@ function TableRenderer(target, source, columns, options) { } } - if (self.emptycontent) { + if (typeof(self.emptycontent) != 'undefined') { + // Make sure the emptycontent is in a div + if (self.emptycontent.nodeName != 'DIV') { + self.emptycontent = DIV(null, self.emptycontent); + insertSiblingNodesBefore(self.table, self.emptycontent); + } + if (self.count > 0) { - hideElement(self.table.previousSibling); + addElementClass(self.emptycontent, 'hidden'); self.table.style.display = ''; } else { self.table.style.display = 'none'; - showElement(self.table.previousSibling); + removeElementClass(self.emptycontent, 'hidden'); } } diff --git a/htdocs/lib/version.php b/htdocs/lib/version.php index 88d36b4e..466b49bd 100644 --- a/htdocs/lib/version.php +++ b/htdocs/lib/version.php @@ -27,7 +27,7 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2007020211; +$config->version = 2007020212; $config->release = '0.6.4'; $config->minupgradefrom = 2007011600; $config->minupgraderelease = '0.4.0 (build tag BUILD_20070122)'; -- GitLab