Remove list row 'unfocused' state and keep 'selected' classes even when list loses focus. For visual distinguishing .focus tr.selected can be used

pull/195/head
Thomas Bruederli 11 years ago
parent f5de03208e
commit 1791a1e7a2

@ -393,16 +393,8 @@ focus: function(e)
if (this.focused) if (this.focused)
return; return;
var n, id;
this.focused = true; this.focused = true;
for (n in this.selection) {
id = this.selection[n];
if (this.rows[id] && this.rows[id].obj) {
$(this.rows[id].obj).addClass('selected').removeClass('unfocused');
}
}
if (e) if (e)
rcube_event.cancel(e); rcube_event.cancel(e);
@ -430,15 +422,7 @@ focus: function(e)
*/ */
blur: function(e) blur: function(e)
{ {
var n, id;
this.focused = false; this.focused = false;
for (n in this.selection) {
id = this.selection[n];
if (this.rows[id] && this.rows[id].obj) {
$(this.rows[id].obj).removeClass('selected focused').addClass('unfocused');
}
}
$(this.list).removeClass('focus'); $(this.list).removeClass('focus');
}, },
@ -1087,7 +1071,7 @@ select_all: function(filter)
this.highlight_row(n, true, true); this.highlight_row(n, true, true);
} }
else { else {
$(this.rows[n].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); $(this.rows[n].obj).removeClass('selected').removeAttr('aria-selected');
} }
} }
@ -1144,7 +1128,7 @@ clear_selection: function(id, no_event)
else { else {
for (n in this.selection) for (n in this.selection)
if (this.rows[this.selection[n]]) { if (this.rows[this.selection[n]]) {
$(this.rows[this.selection[n]].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); $(this.rows[this.selection[n]].obj).removeClass('selected').removeAttr('aria-selected');
} }
this.selection = []; this.selection = [];
@ -1223,7 +1207,7 @@ highlight_row: function(id, multiple, norecur)
a_post = this.selection.slice(p+1, this.selection.length); a_post = this.selection.slice(p+1, this.selection.length);
this.selection = a_pre.concat(a_post); this.selection = a_pre.concat(a_post);
$(this.rows[id].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); $(this.rows[id].obj).removeClass('selected').removeAttr('aria-selected');
if (!norecur && !this.rows[id].expanded) if (!norecur && !this.rows[id].expanded)
this.highlight_children(id, false); this.highlight_children(id, false);
} }

@ -1058,23 +1058,17 @@ table.messagelist.fixedcopy
} }
.messagelist tr.selected td .messagelist tr.selected td
{
color: #FFFFFF;
background-color: #CC3333;
}
.messagelist tr.unfocused td
{ {
color: #FFFFFF; color: #FFFFFF;
background-color: #929292; background-color: #929292;
} }
.messagelist tr.selected td a .messagelist.focus tr.selected td
{ {
color: #FFFFFF; background-color: #CC3333;
} }
.messagelist tr.unfocused td a .messagelist tr.selected td a
{ {
color: #FFFFFF; color: #FFFFFF;
} }

@ -146,13 +146,12 @@
background-position: 4px -1603px; background-position: 4px -1603px;
} }
#contacts-table .contact.selected td.name, #contacts-table .contact.selected td.name {
#contacts-table .contact.unfocused td.name {
background-position: 6px -1627px; background-position: 6px -1627px;
font-weight: bold; font-weight: bold;
} }
#contacts-table .contact.selected.focused td.name { #contacts-table.focus .contact.selected.focused td.name {
background-position: 4px -1627px; background-position: 4px -1627px;
} }
@ -164,13 +163,12 @@
background-position: 4px -1555px; background-position: 4px -1555px;
} }
#contacts-table .group.selected td.name, #contacts-table .group.selected td.name {
#contacts-table .group.unfocused td.name {
background-position: 6px -1579px; background-position: 6px -1579px;
font-weight: bold; font-weight: bold;
} }
#contacts-table .group.selected.focused td.name { #contacts-table.focus .group.selected.focused td.name {
background-position: 4px -1579px; background-position: 4px -1579px;
} }

@ -1224,7 +1224,6 @@ a.iconlink.upload {
.listbox .tablink.selected, .listbox .tablink.selected,
.listbox .listitem.selected > a, .listbox .listitem.selected > a,
.listbox .tablink.selected > a, .listbox .tablink.selected > a,
.listing tbody tr.unfocused td,
.listing tbody tr.selected td, .listing tbody tr.selected td,
.listing li.selected, .listing li.selected,
.listing li.selected > a { .listing li.selected > a {
@ -1577,6 +1576,10 @@ table.records-table {
.records-table tr.selected td { .records-table tr.selected td {
color: #fff !important; color: #fff !important;
background-color: #4db0d2 !important;
}
.records-table.focus tr.selected td {
background: #019bc6; background: #019bc6;
background: -moz-linear-gradient(top, #019bc6 0%, #017cb4 100%); background: -moz-linear-gradient(top, #019bc6 0%, #017cb4 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#019bc6), color-stop(100%,#017cb4)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#019bc6), color-stop(100%,#017cb4));
@ -1590,16 +1593,6 @@ table.records-table {
color: #fff !important; color: #fff !important;
} }
.records-table tr.unfocused td {
color: #fff !important;
background-color: #4db0d2 !important;
}
.records-table tr.unfocused td a,
.records-table tr.unfocused td span {
color: #fff !important;
}
.records-table tr.deleted td, .records-table tr.deleted td,
.records-table tr.deleted td a { .records-table tr.deleted td a {
color: #ccc !important; color: #ccc !important;

Loading…
Cancel
Save