1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-21 07:06:39 +02:00
keeweb/app/scripts/collections/file-collection.js
2019-09-20 22:20:53 +02:00

25 lines
542 B
JavaScript

import { Collection } from 'framework/collection';
import { FileModel } from 'models/file-model';
class FileCollection extends Collection {
static model = FileModel;
hasOpenFiles() {
return this.some(file => file.active);
}
hasUnsavedFiles() {
return this.some(file => file.modified);
}
hasDirtyFiles() {
return this.some(file => file.dirty);
}
getByName(name) {
return this.find(file => file.name.toLowerCase() === name.toLowerCase());
}
}
export { FileCollection };