You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
719 B
JavaScript
32 lines
719 B
JavaScript
class Controller {
|
|
constructor(model, view) {
|
|
this.model = model;
|
|
this.view = view;
|
|
|
|
this.redrawDirTree(view);
|
|
|
|
var cloneBtn = document.getElementsByClassName("clone")[0];
|
|
var purgeBtn = document.getElementsByClassName("purge")[0];
|
|
cloneBtn.addEventListener("click", function () {
|
|
console.log("clone");
|
|
});
|
|
purgeBtn.addEventListener("click", this.purgeFS.bind(this));
|
|
}
|
|
|
|
purgeFS() {
|
|
this.model.purgeFS();
|
|
//this.drawDirTree(this.view);
|
|
this.redrawDirTree(this.view);
|
|
}
|
|
|
|
redrawDirTree(view) {
|
|
this.model.dirTree().then(
|
|
function (value) {
|
|
view.removeDirTree();
|
|
view.drawDirTree(value);
|
|
},
|
|
function (error) {}
|
|
);
|
|
}
|
|
}
|