diff --git a/css/modals.css b/css/modals.css index 9aedb6a..f5740ae 100644 --- a/css/modals.css +++ b/css/modals.css @@ -34,11 +34,11 @@ width: 80px; } -.selectFiles > div > .control-label { +.selectFiles div .control-label { font-weight: normal; margin-left: 30px; } -.selectFiles > div > .controls { +.selectFiles div .controls { margin-left: 30px; } diff --git a/index.html b/index.html index 18551bc..e7cca56 100644 --- a/index.html +++ b/index.html @@ -1028,6 +1028,36 @@ + + + + @@ -1039,17 +1069,7 @@ diff --git a/js/ctrls/modal.js b/js/ctrls/modal.js index 3177c3d..7dc8c9c 100644 --- a/js/ctrls/modal.js +++ b/js/ctrls/modal.js @@ -113,6 +113,23 @@ angular var self = this; this.files = _.cloneDeep(files); + var groupFile = function (files) { + var i, j, str, arr, folder = {}, tmp = folder; + for (i = 0; i < files.length; i++) { + str = files[i].relpath; + arr = str.split("/"); + for (j = 0; j < arr.length - 1; j++) { + if (!tmp[arr[j]]) { + tmp[arr[j]] = {}; + } + tmp = tmp[arr[j]]; + } + tmp[arr[arr.length - 1]] = files[i]; + tmp = folder; + } + return folder; + }; + this.groupedFiles = groupFile(this.files); this.inst = $modal.open({ templateUrl: "selectFiles.html", scope: scope,