From 071d1be3301f85bcf33e2bcfb649979935a6bd31 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 11 May 2014 13:16:15 +0200 Subject: refactor playlist to playseq --- app/index.html | 2 +- app/js/controllers.js | 2 +- app/js/directives.js | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/index.html b/app/index.html index 86f9db3..082899f 100644 --- a/app/index.html +++ b/app/index.html @@ -46,7 +46,7 @@
-
+
diff --git a/app/js/controllers.js b/app/js/controllers.js index 97e6366..11e6950 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -12,7 +12,7 @@ app.controller('pointCtrl', function($scope, $http, pathService){ var update = function(newPoints, newLine) { if(newLine.length > 0) { - $scope.playlist=pathService.computePlaylist(newPoints, newLine, 60); + $scope.playseq=pathService.computePlaylist(newPoints, newLine, 60); } } diff --git a/app/js/directives.js b/app/js/directives.js index 57186f3..f8b8403 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -6,7 +6,7 @@ app.directive('pgLine', function () { replace: 'false', scope: { line: '=', - points: '@' + list: '=' }, template: '', link: function (scope, elems, attrs) { @@ -68,19 +68,19 @@ app.directive('pgLine', function () { - scope.$watchCollection('points', function(newVal) { + scope.$watch('list', function(newPoints) { console.log("update"); - if (newVal) { - - - - paper.project.clear(); - drawPoints(scope.points); + if (newPoints) { + for (var i = 0; i < newPoints.length - 1; ++i) { + if (newPoints[i].selected) { + var line = paper.Path.Line(newPoints[i], newPoints[i+1]); + line.strokeColor = 'red'; + line.strokeWidth = 2; + } + } } }, true); - - - } + } } }); -- cgit v1.2.3