Skip to content

Commit

Permalink
Merge pull request #226 from Kibibit/bugfix-open-project-modal
Browse files Browse the repository at this point in the history
[BUG] Open project modal
  • Loading branch information
thatkookooguy authored Dec 29, 2016
2 parents 8ef2f73 + 94d7c7b commit a5c8f2c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
20 changes: 10 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
"name": "kibibit-code-editor",
"ignore": [],
"dependencies": {
"angular": "^1.5.7",
"angular-animate": "^1.5.7",
"angular-aria": "^1.5.7",
"angular": "~1.6.1",
"angular-animate": "~1.6.1",
"angular-aria": "~1.6.1",
"angular-material": "^1.0.9",
"angular-route": "^1.5.7",
"angular-route": "~1.6.1",
"angular-loading-bar": "^0.9.0",
"octicons": "^4.3.0",
"ng-dialog": "^0.6.2",
"angular-fullscreen": "~1.0.1",
"angular-ui-layout": "~1.4.2",
"ng-scrollbars": "^0.0.10",
"angular-marked": "^1.2.2",
"angular-emoji": "angular-emoji-filter#~0.0.2",
"angular-sanitize": "~1.5.0",
"angular-sanitize": "~1.6.1",
"json-formatter": "^0.6.0",
"ngclipboard": "~1.1.1",
"ng-device-detector": "~3.0.1",
"viewerjs": "fengyuanchen/viewerjs#~0.4.0",
"opentype.js": "^0.6.3",
"underscore": "^1.8.3",
"angular-material-icons": "^0.7.1",
"svg-morpheus": "^0.3.2",
"ui-layout": "Kibibit/ui-layout#~1.0.5",
"angular-emoji": "angular-emoji-filter#~0.0.2",
"viewerjs": "fengyuanchen/viewerjs#~0.4.0",
"ace-builds": "git://github.com/ajaxorg/ace-builds#master",
"highlight.js": "git://github.com/isagalaev/highlight.js#9.2.0"
"highlight.js": "git://github.com/isagalaev/highlight.js#9.2.0",
"ui-layout": "Kibibit/ui-layout#~1.0.5"
},
"resolutions": {
"angular": "1.5.8"
"angular": "1.6.1"
}
}
36 changes: 21 additions & 15 deletions public/app/components/fileTree/fileTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angular.module('kibibitCodeEditor')

vm.browserClass =
deviceDetector.raw.browser.firefox ? 'firefox' : undefined;
vm.onSelection = onSelection;

vm.options = {
selectionMode: 'file',
theme: 'tree-dark'
Expand All @@ -43,20 +43,22 @@ angular.module('kibibitCodeEditor')
return node.type !== 'directory';
}
};
vm.updateTreePath = updateTreePath;

angular.extend(vm.options, vm.userOptions || {});
vm.$onInit = onInit;
vm.onSelection = onSelection;
vm.updateTreePath = updateTreePath;

////////////

// Handle the updated treePath
function updateTreePath(path) {
if (typeof path === 'string' || path instanceof String) {
FolderService.getFolder(path, function(folderContent) {
vm.folderContent = folderContent.data;
});
vm.expandedNodes = [];
}
function closeFolder(folder) {
vm.expandedNodes = vm.expandedNodes.filter(function(node) {
return !node.path.startsWith(folder.path);
});
}

// executed after the controller initiated
function onInit() {
angular.extend(vm.options, vm.userOptions || {});
}

// get file from the server and update the ace session content
Expand Down Expand Up @@ -90,10 +92,14 @@ angular.module('kibibitCodeEditor')
}
}

function closeFolder(folder) {
vm.expandedNodes = vm.expandedNodes.filter(function(node) {
return !node.path.startsWith(folder.path);
});
// Handle the updated treePath
function updateTreePath(path) {
if (typeof path === 'string' || path instanceof String) {
FolderService.getFolder(path, function(folderContent) {
vm.folderContent = folderContent.data;
});
vm.expandedNodes = [];
}
}

}]);
Expand Down

0 comments on commit a5c8f2c

Please sign in to comment.