diff options
Diffstat (limited to 'program/js/list.js')
-rw-r--r-- | program/js/list.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/program/js/list.js b/program/js/list.js index c822aa43b..9b7779c7b 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -195,6 +195,12 @@ init_fixed_header: function() var me = this; $(window).resize(function(){ me.resize() }); + $(window).scroll(function(){ + var w = $(window); + me.fixed_header.css('marginLeft', (-w.scrollLeft()) + 'px'); + if (!bw.webkit) + me.fixed_header.css('marginTop', (-w.scrollTop()) + 'px'); + }); } else { $(this.fixed_header).find('thead').replaceWith(clone); @@ -221,6 +227,8 @@ resize: function() $(this.thead).find('tr td').each(function(index) { $(this).css('width', column_widths[index]); }); + + $(window).scroll(); }, /** @@ -358,7 +366,7 @@ focus: function(e) // Un-focus already focused elements (#1487123, #1487316, #1488600, #1488620) // It looks that window.focus() does the job for all browsers, but not Firefox (#1489058) - $(':focus:not(body)').blur(); + $('iframe,:focus:not(body)').blur(); window.focus(); if (e || (e = window.event)) @@ -1055,7 +1063,7 @@ invert_selection: function() /** * Unselect selected row(s) */ -clear_selection: function(id) +clear_selection: function(id, no_event) { var n, num_select = this.selection.length; @@ -1077,7 +1085,7 @@ clear_selection: function(id) this.selection = []; } - if (num_select && !this.selection.length) + if (num_select && !this.selection.length && !no_event) this.triggerEvent('select'); }, @@ -1130,7 +1138,7 @@ highlight_row: function(id, multiple, norecur) if (!multiple) { if (this.selection.length > 1 || !this.in_selection(id)) { - this.clear_selection(); + this.clear_selection(null, true); this.selection[0] = id; $(this.rows[id].obj).addClass('selected'); } @@ -1362,7 +1370,7 @@ drag_mouse_move: function(e) $(this.row_tagname() + '.selected', this.tbody).each(function() { var uid = self.get_row_uid(this), row = self.rows[uid]; - if (!uid || $.inArray(uid, selection) > -1) + if (!row || $.inArray(uid, selection) > -1) return; selection.push(uid); |