Remove ctrl-d keybinding to discard comment
The ctrl-d binding is dangerous as it removes the unsaved draft comment without confirmation and is a common keybinding when editing text (it is the emacs binding for forward-delete). Esc can still be used to discard unsaved draft comments; removing saved draft comments will now require using the mouse. Change-Id: I30120351f4be0a09ad9404d352fde1408982c05f
This commit is contained in:
@@ -86,8 +86,6 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
|||||||
keysComment = new KeyCommandSet(PatchUtil.C.commentEditorSet());
|
keysComment = new KeyCommandSet(PatchUtil.C.commentEditorSet());
|
||||||
keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 's', PatchUtil.C
|
keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 's', PatchUtil.C
|
||||||
.commentSaveDraft()));
|
.commentSaveDraft()));
|
||||||
keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 'd', PatchUtil.C
|
|
||||||
.commentDiscard()));
|
|
||||||
keysComment.add(new NoOpKeyCommand(0, KeyCodes.KEY_ESCAPE, PatchUtil.C
|
keysComment.add(new NoOpKeyCommand(0, KeyCodes.KEY_ESCAPE, PatchUtil.C
|
||||||
.commentCancelEdit()));
|
.commentCancelEdit()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -102,18 +102,6 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onSave(NULL_CALLBACK);
|
onSave(NULL_CALLBACK);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'd':
|
|
||||||
case 'D':
|
|
||||||
event.preventDefault();
|
|
||||||
if (isNew()) {
|
|
||||||
onDiscard();
|
|
||||||
} else if (Window.confirm(PatchUtil.C.confirmDiscard())) {
|
|
||||||
onDiscard();
|
|
||||||
} else {
|
|
||||||
text.setFocus(true);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ public interface PatchConstants extends Constants {
|
|||||||
String buttonSave();
|
String buttonSave();
|
||||||
String buttonCancel();
|
String buttonCancel();
|
||||||
String buttonDiscard();
|
String buttonDiscard();
|
||||||
String confirmDiscard();
|
|
||||||
|
|
||||||
String noDifference();
|
String noDifference();
|
||||||
String patchHeaderOld();
|
String patchHeaderOld();
|
||||||
@@ -46,7 +45,6 @@ public interface PatchConstants extends Constants {
|
|||||||
String commentEditorSet();
|
String commentEditorSet();
|
||||||
String commentInsert();
|
String commentInsert();
|
||||||
String commentSaveDraft();
|
String commentSaveDraft();
|
||||||
String commentDiscard();
|
|
||||||
String commentCancelEdit();
|
String commentCancelEdit();
|
||||||
|
|
||||||
String whitespaceIGNORE_NONE();
|
String whitespaceIGNORE_NONE();
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ buttonEdit = Edit
|
|||||||
buttonSave = Save
|
buttonSave = Save
|
||||||
buttonCancel = Cancel
|
buttonCancel = Cancel
|
||||||
buttonDiscard = Discard
|
buttonDiscard = Discard
|
||||||
confirmDiscard = Discard this comment?
|
|
||||||
|
|
||||||
noDifference = No Differences
|
noDifference = No Differences
|
||||||
patchHeaderOld = Old Version
|
patchHeaderOld = Old Version
|
||||||
@@ -28,7 +27,6 @@ expandComment = Expand or collapse comment
|
|||||||
commentEditorSet = Comment Editing
|
commentEditorSet = Comment Editing
|
||||||
commentInsert = Create a new inline comment
|
commentInsert = Create a new inline comment
|
||||||
commentSaveDraft = Save draft comment
|
commentSaveDraft = Save draft comment
|
||||||
commentDiscard = Discard draft comment
|
|
||||||
commentCancelEdit = Cancel comment edit
|
commentCancelEdit = Cancel comment edit
|
||||||
|
|
||||||
whitespaceIGNORE_NONE=None
|
whitespaceIGNORE_NONE=None
|
||||||
|
|||||||
Reference in New Issue
Block a user