mirror of https://github.com/keeweb/keeweb.git
fixed enter keypress in custom field title
This commit is contained in:
parent
8021c6bb81
commit
fa17aa4a57
|
@ -70,6 +70,7 @@ class FieldViewCustom extends FieldViewText {
|
||||||
this.labelInput.bind({
|
this.labelInput.bind({
|
||||||
input: this.fieldLabelInput.bind(this),
|
input: this.fieldLabelInput.bind(this),
|
||||||
keydown: this.fieldLabelKeydown.bind(this),
|
keydown: this.fieldLabelKeydown.bind(this),
|
||||||
|
keyup: this.fieldLabelKeyup.bind(this),
|
||||||
keypress: this.fieldLabelInput.bind(this),
|
keypress: this.fieldLabelInput.bind(this),
|
||||||
mousedown: this.fieldLabelInputClick.bind(this),
|
mousedown: this.fieldLabelInputClick.bind(this),
|
||||||
click: this.fieldLabelInputClick.bind(this)
|
click: this.fieldLabelInputClick.bind(this)
|
||||||
|
@ -130,9 +131,7 @@ class FieldViewCustom extends FieldViewText {
|
||||||
fieldLabelKeydown(e) {
|
fieldLabelKeydown(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const code = e.keyCode || e.which;
|
const code = e.keyCode || e.which;
|
||||||
if (code === Keys.DOM_VK_RETURN) {
|
if (code === Keys.DOM_VK_ESCAPE) {
|
||||||
this.endEditTitle(e.target.value);
|
|
||||||
} else if (code === Keys.DOM_VK_ESCAPE) {
|
|
||||||
this.endEditTitle();
|
this.endEditTitle();
|
||||||
} else if (code === Keys.DOM_VK_TAB) {
|
} else if (code === Keys.DOM_VK_TAB) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -140,6 +139,13 @@ class FieldViewCustom extends FieldViewText {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldLabelKeyup(e) {
|
||||||
|
const code = e.keyCode || e.which;
|
||||||
|
if (code === Keys.DOM_VK_RETURN) {
|
||||||
|
this.endEditTitle(e.target.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fieldValueInputClick() {
|
fieldValueInputClick() {
|
||||||
if (this.labelInput) {
|
if (this.labelInput) {
|
||||||
this.endEditTitle(this.labelInput.val());
|
this.endEditTitle(this.labelInput.val());
|
||||||
|
|
Loading…
Reference in New Issue