mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
fix: make tag input add remaining tag on focus lost
This commit is contained in:
parent
aa9d4d819c
commit
e49e3d10e9
10 changed files with 42 additions and 6 deletions
|
@ -32,6 +32,15 @@ class TagsInput {
|
|||
|
||||
/* Handle deletions by clicking the delete button */
|
||||
this.containerNode.addEventListener('click', this._handleContainerClick.bind(this));
|
||||
|
||||
/* Handle clicks outside the input node to add the past tag */
|
||||
this.inputNode.addEventListener('focusout', (evt) => {
|
||||
if (this.inputNode.value) {
|
||||
this.addTag(this.inputNode.value);
|
||||
this.inputNode.value = "";
|
||||
this.updateHiddenInputValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
detach() {
|
||||
|
|
|
@ -350,6 +350,15 @@ class TagsInput {
|
|||
|
||||
/* Handle deletions by clicking the delete button */
|
||||
this.containerNode.addEventListener('click', this._handleContainerClick.bind(this));
|
||||
|
||||
/* Handle clicks outside the input node to add the past tag */
|
||||
this.inputNode.addEventListener('focusout', (evt) => {
|
||||
if (this.inputNode.value) {
|
||||
this.addTag(this.inputNode.value);
|
||||
this.inputNode.value = "";
|
||||
this.updateHiddenInputValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
detach() {
|
||||
|
|
2
public/assets/bundle/archive.min.js
vendored
2
public/assets/bundle/archive.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -71,6 +71,15 @@ class TagsInput {
|
|||
|
||||
/* Handle deletions by clicking the delete button */
|
||||
this.containerNode.addEventListener('click', this._handleContainerClick.bind(this));
|
||||
|
||||
/* Handle clicks outside the input node to add the past tag */
|
||||
this.inputNode.addEventListener('focusout', (evt) => {
|
||||
if (this.inputNode.value) {
|
||||
this.addTag(this.inputNode.value);
|
||||
this.inputNode.value = "";
|
||||
this.updateHiddenInputValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
detach() {
|
||||
|
|
2
public/assets/bundle/generic.min.js
vendored
2
public/assets/bundle/generic.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -350,6 +350,15 @@ class TagsInput {
|
|||
|
||||
/* Handle deletions by clicking the delete button */
|
||||
this.containerNode.addEventListener('click', this._handleContainerClick.bind(this));
|
||||
|
||||
/* Handle clicks outside the input node to add the past tag */
|
||||
this.inputNode.addEventListener('focusout', (evt) => {
|
||||
if (this.inputNode.value) {
|
||||
this.addTag(this.inputNode.value);
|
||||
this.inputNode.value = "";
|
||||
this.updateHiddenInputValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
detach() {
|
||||
|
|
2
public/assets/bundle/user_profile.min.js
vendored
2
public/assets/bundle/user_profile.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue