fixed row/column highlighting

This commit is contained in:
Piotr Przybylski
2011-03-11 23:55:52 +01:00
parent 22bb1aa134
commit ce116ac614
3 changed files with 22 additions and 3 deletions

View File

@@ -594,10 +594,27 @@ $(document).ready(function() {
*/ */
$('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) { $('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) {
//do not trigger when clicked on anchor or inside input element (in inline editing mode) with exception of the first checkbox //do not trigger when clicked on anchor or inside input element (in inline editing mode) with exception of the first checkbox
if (!jQuery(e.target).is('a, a *, :input:not([name^="rows_to_delete"])')) { if ($(e.target).is('a, a *')) {
var $tr = $(this); return;
}
// XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently
var $tr = $(this);
var $checkbox = $tr.find(':checkbox');
if ($checkbox.length) {
// checkbox in a row, add or remove class depending on checkbox state
var checked = $checkbox.attr('checked');
if (!$(e.target).is(':checkbox, label')) {
checked = !checked;
$checkbox.attr('checked', checked);
}
if (checked) {
$tr.addClass('marked');
} else {
$tr.removeClass('marked');
}
} else {
// normaln data table, just toggle class
$tr.toggleClass('marked'); $tr.toggleClass('marked');
$tr.children().toggleClass('marked');
} }
}); });

View File

@@ -206,6 +206,7 @@ table tr.even {
<?php if ($GLOBALS['cfg']['BrowseMarkerEnable']) { ?> <?php if ($GLOBALS['cfg']['BrowseMarkerEnable']) { ?>
/* marked table rows */ /* marked table rows */
td.marked, td.marked,
table tr.marked td,
table tr.marked th, table tr.marked th,
table tr.marked { table tr.marked {
background: <?php echo $GLOBALS['cfg']['BrowseMarkerBackground']; ?>; background: <?php echo $GLOBALS['cfg']['BrowseMarkerBackground']; ?>;

View File

@@ -356,6 +356,7 @@ table tr.even {
<?php if ($GLOBALS['cfg']['BrowseMarkerEnable']) { ?> <?php if ($GLOBALS['cfg']['BrowseMarkerEnable']) { ?>
/* marked table rows */ /* marked table rows */
td.marked, td.marked,
table tr.marked td,
table tr.marked th, table tr.marked th,
table tr.marked { table tr.marked {
background: url(./themes/pmahomme/img/marked_bg.png) repeat-x #b6c6d7; background: url(./themes/pmahomme/img/marked_bg.png) repeat-x #b6c6d7;