mirror of https://github.com/keeweb/keeweb.git
tag selection improvements
This commit is contained in:
parent
1731cc7585
commit
b5879a3793
|
@ -23,7 +23,18 @@ var FieldViewTags = FieldViewText.extend({
|
||||||
|
|
||||||
endEdit: function(newVal, extra) {
|
endEdit: function(newVal, extra) {
|
||||||
if (this.selectedTag) {
|
if (this.selectedTag) {
|
||||||
newVal += (newVal ? ', ' : '') + this.selectedTag;
|
if (newVal) {
|
||||||
|
var tags = this.valueToTags(newVal);
|
||||||
|
var last = tags[tags.length - 1];
|
||||||
|
var isLastPart = last && this.model.tags.indexOf(last) < 0;
|
||||||
|
if (isLastPart) {
|
||||||
|
newVal = newVal.substr(0, newVal.lastIndexOf(last)) + this.selectedTag;
|
||||||
|
} else {
|
||||||
|
newVal += ', ' + this.selectedTag;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newVal = this.selectedTag;
|
||||||
|
}
|
||||||
this.input.val(newVal);
|
this.input.val(newVal);
|
||||||
this.input.focus();
|
this.input.focus();
|
||||||
this.setTags();
|
this.setTags();
|
||||||
|
@ -61,8 +72,10 @@ var FieldViewTags = FieldViewText.extend({
|
||||||
|
|
||||||
getAvailableTags: function() {
|
getAvailableTags: function() {
|
||||||
var tags = this.valueToTags(this.input.val());
|
var tags = this.valueToTags(this.input.val());
|
||||||
|
var last = tags[tags.length - 1];
|
||||||
|
var isLastPart = last && this.model.tags.indexOf(last) < 0;
|
||||||
return this.model.tags.filter(function(tag) {
|
return this.model.tags.filter(function(tag) {
|
||||||
return tags.indexOf(tag) < 0;
|
return tags.indexOf(tag) < 0 && (!isLastPart || tag.toLowerCase().indexOf(last.toLowerCase()) >= 0);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@ Improvements
|
||||||
`+` more reliable binaries management
|
`+` more reliable binaries management
|
||||||
`+` string resources globalization
|
`+` string resources globalization
|
||||||
`+` help/tips
|
`+` help/tips
|
||||||
|
`+` #67: field editing improvements
|
||||||
|
`*` #68: url display without http
|
||||||
`+` #50: notification on password copy
|
`+` #50: notification on password copy
|
||||||
`-` #74: select all in search field
|
`-` #74: select all in search field
|
||||||
`*` #68: url display without http
|
|
||||||
|
|
||||||
##### v0.5.1 (2015-12-15)
|
##### v0.5.1 (2015-12-15)
|
||||||
Layout bugfixes
|
Layout bugfixes
|
||||||
|
|
Loading…
Reference in New Issue