diff --git a/public/javascripts/plugins/cDBtable.js b/public/javascripts/plugins/cDBtable.js index e7444dae5d..de5b612eab 100644 --- a/public/javascripts/plugins/cDBtable.js +++ b/public/javascripts/plugins/cDBtable.js @@ -446,6 +446,23 @@ var target = event.target || event.srcElement; var targetElement = target.nodeName.toLowerCase(); + //Clicking in first column element + Key + if ((targetElement == "div" && event.ctrlKey) || (targetElement == "div" && event.metaKey)) { + $('tbody tr').removeClass('editing'); + $('tbody tr').removeClass('selecting_first'); + $('tbody tr').removeClass('selecting'); + $('tbody tr').removeClass('selecting_last'); + $(target).parent().parent().removeClass('selecting_first').removeClass('border').addClass('selected'); + + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.stopPropagation(); + event.returnValue = false; + } + } + //Clicking in first column element if (targetElement == "a" && $(target).parent().parent().hasClass('first')) { if (!$(target).parent().parent().parent().hasClass('selecting_first')) { @@ -453,6 +470,7 @@ $('tbody tr').removeClass('selecting_first'); $('tbody tr').removeClass('selecting'); $('tbody tr').removeClass('selecting_last'); + $('tbody tr').removeClass('selected'); $(target).parent().parent().parent().addClass('editing'); } @@ -489,13 +507,14 @@ var target = event.target || event.srcElement; var targetElement = target.nodeName.toLowerCase(); - if (targetElement == "div" && $(target).parent().is('td')) { + if (targetElement == "div" && $(target).parent().is('td') && !event.ctrlKey && !event.metaKey) { $('table tbody tr td.first div span').hide(); $('table tbody tr td.first div a.options').removeClass('selected'); $('tbody tr').removeClass('editing'); $('tbody tr').removeClass('selecting_first').removeClass('border'); $('tbody tr').removeClass('selecting'); $('tbody tr').removeClass('selecting_last'); + $('tbody tr').removeClass('selected'); var first_row = $(target).parent().parent(); first_row.addClass('selecting_first'); var initial_x = first_row.position().top; @@ -588,6 +607,7 @@ $('tbody tr[r="'+data.row+'"]').removeClass('border'); $('tbody tr[r="'+data.row+'"]').removeClass('selecting'); $('tbody tr[r="'+data.row+'"]').removeClass('editing'); + $('tbody tr[r="'+data.row+'"]').removeClass('selected'); } if (event.preventDefault) { event.preventDefault(); diff --git a/public/stylesheets/admin/cDBtable.css b/public/stylesheets/admin/cDBtable.css index 892d9a9a88..b6af5d5693 100644 --- a/public/stylesheets/admin/cDBtable.css +++ b/public/stylesheets/admin/cDBtable.css @@ -72,6 +72,10 @@ div.table_position table tbody tr td.first div span div.line {float:left; width: /*SELECTED ROWS*/ div.table_position table tbody tr.selecting td {background-position:0 -40px;} +div.table_position table tbody tr.selected td {background-position:0 -40px; border-top:2px solid #666666; border-bottom:4px solid #666666;} +div.table_position table tbody tr.selected td div {padding:11px 13px 10px 13px;} +div.table_position table tbody tr.selected td.first {height:35px!important;} + /*last row selected*/ div.table_position table tbody tr.selecting_last.border td {border-bottom:4px solid #666666;} div.table_position table tbody tr.selecting_last.border td div {padding:13px 13px 9px 13px;} @@ -84,11 +88,11 @@ div.table_position table tbody tr.selecting_first.border td.first div a.options /*td first*/ div.table_position table tbody tr.selecting td.first div a.options {display:none;} div.table_position table tbody tr.selecting_last td.first div a.options {display:none;} -div.table_position table tbody tr.selecting_first td.first div a.options {display:block; background-position:0 -28px;} -div.table_position table tbody tr.selecting_first td.first div a.options:hover {background-position:0 -42px;} -div.table_position table tbody tr.selecting_first td.first div span {top:28px;} -div.table_position table tbody tr.selecting_first td.first div a.options.selected {height:20px; background-position:0 0;} -div.table_position table tbody tr.selecting_first td.first div a.options.selected:hover {background-position:0 0;} +div.table_position table tbody tr.selecting_first.border td.first div a.options {display:block; background-position:0 -28px;} +div.table_position table tbody tr.selecting_first.border td.first div a.options:hover {background-position:0 -42px;} +div.table_position table tbody tr.selecting_first.border td.first div span {top:28px;} +div.table_position table tbody tr.selecting_first.border td.first div a.options.selected {height:20px; background-position:0 0;} +div.table_position table tbody tr.selecting_first.border td.first div a.options.selected:hover {background-position:0 0;} /*END SELECTED ROWS*/ div.table_position table tbody tr.editing td {background-position:0 -40px!important;} div.table_position table tbody tr.editing td div {padding:13px;}