mirror of
https://github.com/xenia-project/xenia.git
synced 2026-04-06 07:03:33 +00:00
Function listing and selection.
This commit is contained in:
parent
a631ada0f7
commit
4ecdfed46f
16 changed files with 314 additions and 65 deletions
|
|
@ -17,16 +17,42 @@ var module = angular.module('xe.ui.code', [
|
|||
|
||||
module.controller('CodeTabController', function(
|
||||
$rootScope, $scope, app, log) {
|
||||
$scope.moduleList = [];
|
||||
$scope.selectedModule = null;
|
||||
$scope.functionList = [];
|
||||
|
||||
$rootScope.$on('refresh', function() {
|
||||
var dataSource = app.session.dataSource;
|
||||
|
||||
dataSource.getModuleList().then(function(list) {
|
||||
console.log(list);
|
||||
$scope.moduleList = list;
|
||||
if (!$scope.selectedModule) {
|
||||
if (list.length) {
|
||||
$scope.selectModule(list[0]);
|
||||
}
|
||||
} else {
|
||||
$scope.selectModule($scope.selectedModule);
|
||||
}
|
||||
}, function(e) {
|
||||
log('Unable to fetch module list');
|
||||
log.error('Unable to fetch module list');
|
||||
});
|
||||
|
||||
console.log('refresh');
|
||||
});
|
||||
|
||||
$scope.selectModule = function(module) {
|
||||
var moduleChange = module != $scope.selectedModule;
|
||||
$scope.selectedModule = module;
|
||||
|
||||
if (moduleChange) {
|
||||
$scope.functionList = [];
|
||||
}
|
||||
|
||||
var dataSource = app.session.dataSource;
|
||||
dataSource.getFunctionList(module.name).then(function(list) {
|
||||
$scope.functionList = list;
|
||||
}, function(e) {
|
||||
log.error('Unable to fetch function list');
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue