From 2acc8cb2b431751dc7ff10956afc290dfe0616ef Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Tue, 26 Sep 2017 17:25:59 -0600 Subject: [PATCH] werking --- js/controllers/website-controller.js | 35 ++++++++++++++++++++++++++-- templates/website.html | 1 - templates/widgets/filetree.html | 9 ++++++- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 7b93933..84a92f1 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -344,9 +344,23 @@ app.controller('websiteCtrl', [ window.alert(JSON.stringify(result)); }); }; + + + + Array.prototype.remByVal = function(val) { + for (var i = 0; i < this.length; i++) { + if (this[i] === val) { + this.splice(i, 1); + i--; + } + } + return this; + }; + // TODO: finish thissssssss vm.breadcrumbs = ['Root']; vm.breadcrumbsPath = ['/']; + vm.blah = false; vm.Sites.contents = function (r) { vm.siteResults = r; vm.directoryPath = r.newPath; @@ -362,6 +376,21 @@ app.controller('websiteCtrl', [ vm.breadcrumbs.push(path); vm.breadcrumbsPath.push(path); } + if (vm.blah) { + if (path === 'Root') { + vm.breadcrumbs = ['Root']; + vm.breadcrumbsPath = ['/']; + vm.activePath = 'active' + vm.blah = false; + } else { + var breadcrumbsPath = vm.breadcrumbsPath; + var breadcrumbs = vm.breadcrumbs; + var removeFromBreadcrumbsPath = breadcrumbsPath.indexOf(path) + 1; + var removeFromBreadcrumbs = breadcrumbs.indexOf(path) + 1; + vm.breadcrumbsPath = breadcrumbsPath.splice(0,removeFromBreadcrumbsPath); + vm.breadcrumbs = breadcrumbs.splice(0,removeFromBreadcrumbs); + } + } } updatePath(newPath); return pkg.contents({ @@ -394,8 +423,10 @@ app.controller('websiteCtrl', [ }; vm.doSomething = function (x) { - console.log('path requested', x); - console.log('current path', vm.breadcrumbsPath); + vm.blah = true; + vm.siteDirectories = []; + vm.siteFiles = []; + vm.getSiteContents(x); }; vm.Shares = {}; diff --git a/templates/website.html b/templates/website.html index ca87f7a..87f1afd 100644 --- a/templates/website.html +++ b/templates/website.html @@ -178,7 +178,6 @@ -->
-
diff --git a/templates/widgets/filetree.html b/templates/widgets/filetree.html index 757d4cb..2f65687 100644 --- a/templates/widgets/filetree.html +++ b/templates/widgets/filetree.html @@ -1,7 +1,8 @@
+
+
+

TODO:// Add functionality

+ +
+