From 49771b1039b9beef6c78ecc1e52157384f8dcd8f Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 23 Oct 2009 14:11:41 -0400
Subject: [PATCH] - Don't display disabled sections in Settings (#1486099)

---
 program/js/list.js |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/program/js/list.js b/program/js/list.js
index 01ad5f3..357a77a 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -320,7 +320,7 @@
 
 
 /**
- * get next/previous/last rows that are not hidden
+ * get first/next/previous/last rows that are not hidden
  */
 get_next_row: function()
 {
@@ -346,6 +346,20 @@
     new_row = new_row.previousSibling;
 
   return new_row;
+},
+
+get_first_row: function()
+{
+  if (this.rowcount)
+    {
+    var rows = this.list.tBodies[0].rows;
+
+    for(var i=0; i<rows.length-1; i++)
+      if(rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null)
+	return RegExp.$1;
+    }
+
+  return null;
 },
 
 get_last_row: function()
@@ -451,6 +465,16 @@
     this.select_row(new_row.uid, false, false);  
 },
 
+/**
+ * Select first row 
+ */
+select_first: function()
+{
+  var first_row = this.get_first_row();
+  if (first_row)
+    this.select_row(first_row, false, false);  
+},
+
 
 /**
  * Perform selection when shift key is pressed

--
Gitblit v1.9.1