1
0
Fork 0
ember-file-download-list-ex.../app/components/file-table.js

19 lines
445 B
JavaScript

import Component from '@ember/component';
const defaultFiles = [];
const defaultSelectedFilePaths = [];
export default Component.extend({
files: defaultFiles,
selectedFilePaths: defaultSelectedFilePaths,
actions: {
toggleSelectedPath(path) {
if (!this.selectedFilePaths.includes(path)) {
this.selectedFilePaths.pushObject(path);
} else {
this.selectedFilePaths.removeObject(path);
}
},
}
});