mirror of https://github.com/keeweb/keeweb.git
fix #377: auto-type filtering issues
This commit is contained in:
parent
1db38c595d
commit
2923fbd846
|
@ -14,7 +14,8 @@ let AutoTypeFilter = function(windowInfo, appModel) {
|
|||
|
||||
AutoTypeFilter.prototype.getEntries = function() {
|
||||
let filter = {
|
||||
text: this.text
|
||||
text: this.text,
|
||||
autoType: true
|
||||
};
|
||||
let entries = this.appModel.getEntriesByFilter(filter);
|
||||
if (!this.ignoreWindowInfo && this.hasWindowInfo()) {
|
||||
|
|
|
@ -190,7 +190,8 @@ var EntryModel = Backbone.Model.extend({
|
|||
return !filter ||
|
||||
(!filter.tagLower || this.searchTags.indexOf(filter.tagLower) >= 0) &&
|
||||
(!filter.textLower || (filter.advanced ? this.matchesAdv(filter) : this.searchText.indexOf(filter.textLower) >= 0)) &&
|
||||
(!filter.color || filter.color === true && this.searchColor || this.searchColor === filter.color);
|
||||
(!filter.color || filter.color === true && this.searchColor || this.searchColor === filter.color) &&
|
||||
(!filter.autoType || this.autoTypeEnabled);
|
||||
},
|
||||
|
||||
matchesAdv: function(filter) {
|
||||
|
|
|
@ -172,7 +172,7 @@ var FileModel = Backbone.Model.extend({
|
|||
group.forEachOwnEntry(null, entry => {
|
||||
entryMap[entry.id] = entry;
|
||||
});
|
||||
}, true);
|
||||
}, { includeDisabled: true });
|
||||
this.entryMap = entryMap;
|
||||
this.groupMap = groupMap;
|
||||
},
|
||||
|
@ -282,15 +282,15 @@ var FileModel = Backbone.Model.extend({
|
|||
if (!filter.group || filter.subGroups) {
|
||||
top.forEachGroup(group => {
|
||||
group.forEachOwnEntry(filter, callback);
|
||||
});
|
||||
}, filter);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
forEachGroup: function(callback, includeDisabled) {
|
||||
forEachGroup: function(callback, filter) {
|
||||
this.get('groups').forEach(group => {
|
||||
if (callback(group) !== false) {
|
||||
group.forEachGroup(callback, includeDisabled);
|
||||
group.forEachGroup(callback, filter);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -107,11 +107,11 @@ var GroupModel = MenuItemModel.extend({
|
|||
this.group.times.update();
|
||||
},
|
||||
|
||||
forEachGroup: function(callback, includeDisabled) {
|
||||
forEachGroup: function(callback, filter) {
|
||||
var result = true;
|
||||
this.get('items').forEach(group => {
|
||||
if (includeDisabled || group.group.enableSearching !== false) {
|
||||
result = callback(group) !== false && group.forEachGroup(callback, includeDisabled) !== false;
|
||||
if (group.matches(filter)) {
|
||||
result = callback(group) !== false && group.forEachGroup(callback, filter) !== false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
@ -125,6 +125,11 @@ var GroupModel = MenuItemModel.extend({
|
|||
});
|
||||
},
|
||||
|
||||
matches: function(filter) {
|
||||
return (filter && filter.includeDisabled || this.group.enableSearching !== false) &&
|
||||
(!filter || !filter.autoType || this.group.enableAutoType !== false);
|
||||
},
|
||||
|
||||
getOwnSubGroups: function() {
|
||||
return this.group.groups;
|
||||
},
|
||||
|
|
|
@ -8,6 +8,7 @@ Release notes
|
|||
`+` text fields context menu on desktop
|
||||
`+` option to disable latest file removal
|
||||
`-` fix #432: drag-drop in vivaldi
|
||||
`-` fix auto-type enabled/disabled issues
|
||||
|
||||
##### v1.3.3 (2016-09-20)
|
||||
`+` translations: fr, pl, pt
|
||||
|
|
Loading…
Reference in New Issue