1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-26 07:39:04 +02:00
keeweb/app/scripts/collections/file-collection.js
2020-04-15 16:50:01 +02:00

25 lines
532 B
JavaScript

import { Collection } from 'framework/collection';
import { Model } from 'framework/model';
class FileCollection extends Collection {
static model = Model;
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 };