summaryrefslogtreecommitdiff
path: root/program/js/list.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/list.js')
-rw-r--r--program/js/list.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/program/js/list.js b/program/js/list.js
index e3a38ba7f..f33be87b3 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -249,6 +249,9 @@ clear: function(sel)
// reset scroll position (in Opera)
if (this.frame)
this.frame.scrollTop = 0;
+
+ // fix list header after removing any rows
+ this.resize();
},
@@ -257,7 +260,7 @@ clear: function(sel)
*/
remove_row: function(uid, sel_next)
{
- var node = this.rows[uid] ? this.rows[uid].obj : null;
+ var self = this, node = this.rows[uid] ? this.rows[uid].obj : null;
if (!node)
return;
@@ -269,6 +272,10 @@ remove_row: function(uid, sel_next)
delete this.rows[uid];
this.rowcount--;
+
+ // fix list header after removing any rows
+ clearTimeout(this.resize_timeout)
+ this.resize_timeout = setTimeout(function() { self.resize(); }, 50);
},
@@ -277,7 +284,7 @@ remove_row: function(uid, sel_next)
*/
insert_row: function(row, before)
{
- var tbody = this.tbody;
+ var self = this, tbody = this.tbody;
// create a real dom node first
if (row.nodeName === undefined) {
@@ -305,6 +312,10 @@ insert_row: function(row, before)
this.init_row(row);
this.rowcount++;
+
+ // fix list header after adding any rows
+ clearTimeout(this.resize_timeout)
+ this.resize_timeout = setTimeout(function() { self.resize(); }, 50);
},
/**