49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
angular.module('satbd.satellite.bar', ['ui.bootstrap','ngAnimate']);
|
|
|
|
angular.module('satbd.satellite.bar').controller('GlobalCtrl', function($scope) {
|
|
$scope.location = ''
|
|
$scope.isActive = function(location) {
|
|
return $scope.location == location
|
|
};
|
|
|
|
|
|
});
|
|
|
|
angular.module('satbd.satellite.bar').controller('NavbarCollapseCtrl', function ($scope, $uibModal) {
|
|
$scope.isCollapsed = true;
|
|
$scope.openModal = function (size) {
|
|
var modalInstance = $uibModal.open({
|
|
templateUrl: 'help.html',
|
|
controller: 'HelpInstanceCtrl',
|
|
size: size,
|
|
keyboard: true,
|
|
});
|
|
};
|
|
|
|
});
|
|
|
|
angular.module('satbd.satellite.bar').controller('HelpInstanceCtrl', function($scope, $uibModalInstance) {
|
|
$scope.ok = function () {
|
|
$uibModalInstance.close('');
|
|
};
|
|
});
|
|
|
|
angular.module('satbd.satellite.bar').controller('RecentCtrl', function($scope, $http,$log) {
|
|
$scope.albumIDs = [ ];
|
|
$http.get('/api/recents').success(function(data){
|
|
for (var i = 0; i < 10; i++) {
|
|
$scope.albumIDs.push(data[i])
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
|
|
angular.module('satbd.satellite.bar').controller('RecentAlbumCtrl', function($scope, $http) {
|
|
$scope.init_by_id = function(id) {
|
|
$http.get('api/albums/'+ id).success(function (data) {
|
|
$scope.album = data;
|
|
});
|
|
};
|
|
});
|