From c8596993092ddfd7bb3e8f3f65e13d5ca39b6e51 Mon Sep 17 00:00:00 2001 From: Pat Long Date: Wed, 25 Nov 2015 14:28:10 -0800 Subject: [PATCH 1/3] created controller for ui-scrollpoint and moved settings in here, allowing other directives to extend on ui-scrollpoint. ui-scrollpoint-pin directive --- demo/index.html | 27 +++--- dist/scrollpoint.js | 191 ++++++++++++++++++++++++++++++---------- dist/scrollpoint.min.js | 4 +- src/scrollpoint.js | 189 +++++++++++++++++++++++++++++---------- 4 files changed, 301 insertions(+), 110 deletions(-) diff --git a/demo/index.html b/demo/index.html index b05dc71..d5bcb20 100644 --- a/demo/index.html +++ b/demo/index.html @@ -16,12 +16,10 @@ $rootScope.$broadcast('scrollpointShouldReset'); }; $scope.scrollAction = function(element, distance){ - // scroll events are triggered by DOM, so use $scope.$apply(); - $scope.$apply(function(){ - $scope.actionClass = (distance < 0) ? 'warning' : 'info'; - $scope.actionDistance = distance; - }); + $scope.actionClass = (distance < 0) ? 'warning' : 'info'; + $scope.actionDistance = distance; }; + $scope.word = 'scrollin'; });