Merge "ChangeScreen2: Don't open files with middle click"
This commit is contained in:
@@ -113,6 +113,7 @@ class FileTable extends FlowPanel {
|
|||||||
if (t != null) {
|
if (t != null) {
|
||||||
t.onOpenRow(1 + idx);
|
t.onOpenRow(1 + idx);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,11 +312,11 @@ class FileTable extends FlowPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCellSingleClick(int row, int column) {
|
protected void onCellSingleClick(Event event, int row, int column) {
|
||||||
if (column == C_PATH) {
|
if (column == C_PATH && link.handleAsClick(event)) {
|
||||||
onOpenRow(row);
|
onOpenRow(row);
|
||||||
} else {
|
} else {
|
||||||
super.onCellSingleClick(row, column);
|
super.onCellSingleClick(event, row, column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
|||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.user.client.DOM;
|
import com.google.gwt.user.client.DOM;
|
||||||
import com.google.gwt.user.client.Element;
|
import com.google.gwt.user.client.Element;
|
||||||
|
import com.google.gwt.user.client.Event;
|
||||||
import com.google.gwt.user.client.ui.Anchor;
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
|
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
|
||||||
@@ -40,6 +41,7 @@ import com.google.gwt.user.client.ui.InlineLabel;
|
|||||||
import com.google.gwt.user.client.ui.UIObject;
|
import com.google.gwt.user.client.ui.UIObject;
|
||||||
import com.google.gwtexpui.safehtml.client.SafeHtml;
|
import com.google.gwtexpui.safehtml.client.SafeHtml;
|
||||||
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||||
|
|
||||||
import org.eclipse.jgit.diff.Edit;
|
import org.eclipse.jgit.diff.Edit;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -76,8 +78,8 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCellSingleClick(int row, int column) {
|
protected void onCellSingleClick(Event event, int row, int column) {
|
||||||
super.onCellSingleClick(row, column);
|
super.onCellSingleClick(event, row, column);
|
||||||
if (column == 1 || column == 4) {
|
if (column == 1 || column == 4) {
|
||||||
onCellDoubleClick(row, column);
|
onCellDoubleClick(row, column);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.google.gerrit.reviewdb.client.PatchLineComment;
|
|||||||
import com.google.gerrit.reviewdb.client.PatchSet;
|
import com.google.gerrit.reviewdb.client.PatchSet;
|
||||||
import com.google.gwt.user.client.DOM;
|
import com.google.gwt.user.client.DOM;
|
||||||
import com.google.gwt.user.client.Element;
|
import com.google.gwt.user.client.Element;
|
||||||
|
import com.google.gwt.user.client.Event;
|
||||||
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
|
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
|
||||||
import com.google.gwt.user.client.ui.UIObject;
|
import com.google.gwt.user.client.ui.UIObject;
|
||||||
import com.google.gwtexpui.safehtml.client.SafeHtml;
|
import com.google.gwtexpui.safehtml.client.SafeHtml;
|
||||||
@@ -98,8 +99,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCellSingleClick(int row, int column) {
|
protected void onCellSingleClick(Event event, int row, int column) {
|
||||||
super.onCellSingleClick(row, column);
|
super.onCellSingleClick(event, row, column);
|
||||||
if (column == 1 || column == 2) {
|
if (column == 1 || column == 2) {
|
||||||
if (!"".equals(table.getText(row, column))) {
|
if (!"".equals(table.getText(row, column))) {
|
||||||
onCellDoubleClick(row, column);
|
onCellDoubleClick(row, column);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
|
|||||||
}
|
}
|
||||||
final int row = rowOf(td);
|
final int row = rowOf(td);
|
||||||
if (getRowItem(row) != null) {
|
if (getRowItem(row) != null) {
|
||||||
onCellSingleClick(rowOf(td), columnOf(td));
|
onCellSingleClick(event, rowOf(td), columnOf(td));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -145,7 +145,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Invoked when the user clicks on a table cell. */
|
/** Invoked when the user clicks on a table cell. */
|
||||||
protected void onCellSingleClick(int row, int column) {
|
protected void onCellSingleClick(Event event, int row, int column) {
|
||||||
movePointerTo(row);
|
movePointerTo(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user