summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-02-06 18:58:56 -0800
committerShawn O. Pearce <sop@google.com>2009-02-06 18:58:56 -0800
commit719986649a505650a12133a0cca26456c1ae91db (patch)
tree7e5354143f806f220fde168eded895f950973fc8
parenta8836dffe8cd0fceb88a1a60829b25f063eab8f5 (diff)
Clip all change subject lines at 80 columns in change tables
Firefox 3.0.6 and Safari 3.2.1 don't honor the overflow:hidden style we use for the subject column of the change table. All other browsers (Opera, Firefox 2, Camino) honor this style and clip the subject line rather than making the table wider than the browser window. Firefox 3 and Safari however are making the table as wide as necessary to display everything, which results in the trailing columns being place off screen when someone uses a subject that is longer than expected. Until I find a workaround in CSS that allows all browsers to do automatic resizing of this column, I'm artificially clipping it at 80 characters during display. This is wide enough that any reasonable message will fit without clipping, but not so wide as to cause the tables to be unusable on a laptop display. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--src/main/java/com/google/gerrit/client/changes/ChangeTable.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/gerrit/client/changes/ChangeTable.java b/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
index 5a69938bb8..c3687956c2 100644
--- a/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
+++ b/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
@@ -222,6 +222,9 @@ public class ChangeTable extends FancyFlexTable<ChangeInfo> {
table.setWidget(row, C_ID, new TableChangeLink(idstr, c));
String s = c.getSubject();
+ if (s.length() > 80) {
+ s = s.substring(0, 80);
+ }
if (c.getStatus() != null && c.getStatus() != Change.Status.NEW) {
s += " (" + c.getStatus().name() + ")";
}