mirror of https://github.com/keeweb/keeweb.git
entries filter
This commit is contained in:
parent
8093279b95
commit
39b5451bfd
|
@ -9,7 +9,14 @@ let AutoTypeFilter = function(windowInfo, appModel) {
|
|||
};
|
||||
|
||||
AutoTypeFilter.prototype.getEntries = function() {
|
||||
return this.appModel.getEntries(); // TODO
|
||||
let filter = {
|
||||
text: this.text
|
||||
};
|
||||
if (!this.ignoreWindowInfo) {
|
||||
filter.title = this.title; // TODO
|
||||
filter.url = this.url; // TODO
|
||||
}
|
||||
return this.appModel.getEntriesByFilter(filter); // TODO: sort entries
|
||||
};
|
||||
|
||||
module.exports = AutoTypeFilter;
|
||||
|
|
|
@ -214,16 +214,16 @@ var AppModel = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
getEntries: function() {
|
||||
var filter = this.prepareFilter();
|
||||
let entries = this.getEntriesByFilter(filter);
|
||||
let entries = this.getEntriesByFilter(this.filter);
|
||||
entries.sortEntries(this.sort);
|
||||
if (filter.trash) {
|
||||
if (this.filter.trash) {
|
||||
this.addTrashGroups(entries);
|
||||
}
|
||||
return entries;
|
||||
},
|
||||
|
||||
getEntriesByFilter: function(filter) {
|
||||
filter = this.prepareFilter(filter);
|
||||
var entries = new EntryCollection();
|
||||
this.files.forEach(file => {
|
||||
file.forEachEntry(filter, entry => entries.push(entry));
|
||||
|
@ -242,8 +242,8 @@ var AppModel = Backbone.Model.extend({
|
|||
});
|
||||
},
|
||||
|
||||
prepareFilter: function() {
|
||||
var filter = _.clone(this.filter);
|
||||
prepareFilter: function(filter) {
|
||||
filter = _.clone(filter);
|
||||
if (filter.text) {
|
||||
filter.textLower = filter.text.toLowerCase();
|
||||
}
|
||||
|
|
|
@ -62,12 +62,19 @@
|
|||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
tr.at-select__item {
|
||||
border-right-width: 3px;
|
||||
}
|
||||
td, th {
|
||||
padding: $base-padding;
|
||||
&:first-of-type {
|
||||
width: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
&:first-of-type { width: 1em; text-align: center; }
|
||||
&:nth-of-type(2) { width: 50%; }
|
||||
&:nth-of-type(3) { width: 25%; }
|
||||
&:nth-of-type(4) { width: 25%; }
|
||||
}
|
||||
}
|
||||
&__item {
|
||||
|
|
Loading…
Reference in New Issue