Skip to content

Commit

Permalink
#2 Introduced previous and next buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
juandavidvillacalle committed Jul 16, 2014
1 parent 48a6453 commit 0930926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web-client/app/controllers/ImagesCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ angular.module('collaboroControllers').controller('imagesCtrl', ['$scope',functi
//$scope.addSlide();
}

$scope.nextImage=function(){if($scope.notationImageIndex+1<$scope.slides.length){$scope.notationImageIndex++;}else{$scope.notationImageIndex=0;}};
$scope.previousImage=function(){if($scope.notationImageIndex-1>=0){$scope.notationImageIndex--;}else{$scope.notationImageIndex=$scope.slides.length-1}};


//$scope.sportImages = ['http://placekitten.com/600/300','http://placekitten.com/601/300','http://placekitten.com/602/300'];
//$scope.sportImages = ['http://placekitten.com/604/300','http://placekitten.com/601/300','http://placekitten.com/602/300'];

Expand Down
2 changes: 2 additions & 0 deletions web-client/app/partials/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ <h3 class="panel-title">Notation examples</h3>
<div class="panel-body">
<div ng-controller="imagesCtrl">
<img style="height:305px;" ng-src="{{slides[notationImageIndex].image}}">
<button ng-click="previousImage()" class="btn btn-default btn-sm"><<</button>
<button ng-click="nextImage()" class="btn btn-default btn-sm">>></button>
<!--<div style="height:305 px width:600">-->
<!--<ul rn-carousel class="image">
<li ng-repeat="image in sportImages" ng-style="{ backgroundImage: 'url(' + image + ')' }">
Expand Down

0 comments on commit 0930926

Please sign in to comment.