This repository has been archived on 2020-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
sp4ke.github.com/js/controllers.js
2014-11-21 00:03:52 +01:00

87 lines
2.1 KiB
JavaScript

// Generated by CoffeeScript 1.8.0
(function() {
this.projectsCtrl = function($scope) {
$scope.carousels = {
uman: ['/img/uman1.png', '/img/uman2.png']
};
$scope.selectedItem = 'simplifield';
return $scope.select = function(item) {
if ($scope.selectedItem === item) {
return $scope.selectedItem = void 0;
} else {
return $scope.selectedItem = item;
}
};
};
projectsCtrl.$inject = ['$scope'];
this.dockCtrl = function($scope, $location, $window) {
var defaultSelected;
$scope.icons = [
{
"class": 'profil',
icon: 'icon-user',
link: '/freelance',
text: 'What I Do'
}, {
"class": 'projects',
icon: 'icon-laptop',
link: '/projects',
text: 'My work'
}, {
"class": 'contact',
icon: 'icon-phone',
link: '/contact',
text: 'Get in touch'
}, {
"class": 'blog',
icon: 'icon-book',
link: '/blog',
text: 'Ideas'
}
];
$scope.selected = null;
defaultSelected = function() {
var icon, _i, _len, _ref, _results;
_ref = $scope.icons;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
icon = _ref[_i];
if ($location.path() === icon.link) {
_results.push($scope.selected = $scope.icons.indexOf(icon));
} else {
_results.push(void 0);
}
}
return _results;
};
defaultSelected();
return $scope["switch"] = function($index) {
if ($index === 3) {
$window.location.hash = '';
$window.location.pathname = '/blog';
return;
}
if ($scope.selected === $index) {
$location.path('/');
return $scope.selected = null;
} else {
$scope.selected = $index;
return $location.path($scope.icons[$index].link);
}
};
};
dockCtrl.$inject = ['$scope', '$location', '$window'];
window.MyCtrl1 = function() {};
MyCtrl1.$inject = [];
window.MyCtrl2 = function() {};
MyCtrl2.$inject = [];
}).call(this);