add clone functionality

This commit is contained in:
2020-12-20 16:03:47 +01:00
parent 62cb680181
commit 77352b3c10
5 changed files with 30 additions and 11 deletions

View File

@@ -7,18 +7,26 @@ class Controller {
var cloneBtn = document.getElementsByClassName("clone")[0];
var purgeBtn = document.getElementsByClassName("purge")[0];
cloneBtn.addEventListener("click", function () {
console.log("clone");
});
cloneBtn.addEventListener("click", this.cloneRep.bind(this));
purgeBtn.addEventListener("click", this.purgeFS.bind(this));
}
purgeFS() {
this.model.purgeFS();
//this.drawDirTree(this.view);
//window.location.reload();
this.redrawDirTree(this.view);
}
cloneRep(repurl) {
var that = this;
this.model.cloneRep().then(
function (value) {
that.redrawDirTree(that.view);
},
function (error) {}
);
}
redrawDirTree(view) {
this.model.dirTree().then(
function (value) {