You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

66 lines
1.5 KiB
CoffeeScript

#Controllers
#
@projectsCtrl = ($scope)->
projectsCtrl.$inject = ['$scope']
@dockCtrl = ($scope, $location)->
$scope.icons = [
class: 'profil'
icon: 'icon-user'
link: '/freelance'
text: 'What I Do'
,
class: 'projects'
icon: 'icon-laptop'
link: '/projects'
text: 'My work'
,
class: 'blog'
icon: 'icon-book'
link: '/blog'
text: 'Ideas'
,
class: 'contact'
icon: 'icon-envelope-alt'
link: '/contact'
text: 'Get in touch'
]
$scope.hovered = false
$scope.hoverText = ($index)->
$scope.hovered = true
$scope.hoveredIndex = $index
console.log $scope.hovered
$scope.hoverOut = ()->
$scope.hovered = false
$scope.hoveredIndex = null
$scope.selected = null
defaultSelected = ()->
for icon in $scope.icons
if $location.path() is icon.link
$scope.selected = $scope.icons.indexOf icon
defaultSelected()
$scope.switch = ($index)->
if $scope.selected is $index
$location.path('/')
$scope.selected = null
else
$scope.selected = $index
$location.path($scope.icons[$index].link)
dockCtrl.$inject = ['$scope', '$location']
window.MyCtrl1 = ()->
MyCtrl1.$inject = []
window.MyCtrl2 = ()->
MyCtrl2.$inject = []