A better way to handle clashing between row highlighting and inline edit.

This commit is contained in:
Madhura Jayaratne
2011-03-15 20:57:47 +05:30
parent 326f13827b
commit da0fc40022
2 changed files with 4 additions and 4 deletions

View File

@@ -594,7 +594,7 @@ $(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 ($(e.target).is('a, a *') || $(e.target).parents('tr').find('td:nth(2)').hasClass('inline_edit_active')) { if ($(e.target).is('a, a *')) {
return; return;
} }
// XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently // XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently

View File

@@ -416,7 +416,7 @@ $(document).ready(function() {
$(".inline_edit_anchor").live('click', function(event) { $(".inline_edit_anchor").live('click', function(event) {
/** @lends jQuery */ /** @lends jQuery */
event.preventDefault(); event.preventDefault();
$(this).removeClass('inline_edit_anchor').addClass('inline_edit_active'); $(this).removeClass('inline_edit_anchor').addClass('inline_edit_active').parent('tr').addClass('noclick');
// adding submit and hide buttons to inline edit <td> // adding submit and hide buttons to inline edit <td>
// for "hide", button the original data to be restored is present in .original_data // for "hide", button the original data to be restored is present in .original_data
@@ -442,7 +442,7 @@ $(document).ready(function() {
var $this_hide = $(this).parent(); var $this_hide = $(this).parent();
$this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor"); $this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor");
$this_hide.parent().removeClass("hover"); $this_hide.parent().removeClass("hover noclick");
$this_hide.siblings().removeClass("hover"); $this_hide.siblings().removeClass("hover");
var last_column = $this_hide.siblings().length; var last_column = $this_hide.siblings().length;
@@ -898,7 +898,7 @@ $(document).ready(function() {
PMA_ajaxShowMessage(data.message); PMA_ajaxShowMessage(data.message);
$this_td.removeClass('inline_edit_active hover').addClass('inline_edit_anchor'); $this_td.removeClass('inline_edit_active hover').addClass('inline_edit_anchor');
$this_td.parent().removeClass('hover') $this_td.parent().removeClass('hover noclick');
$this_td.siblings().removeClass('hover'); $this_td.siblings().removeClass('hover');
$input_siblings.each(function() { $input_siblings.each(function() {