From f5fa4aff8e9c9f9317d10dddf77c4f6a4607dea6 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Sat, 7 Nov 2015 16:00:22 -0500 Subject: #67 - make mousewheel work in desktop mode Former-commit-id: 804af14ecf932ca4f4bc2f3cbc4a3261cc096f30 --- www/js/app.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'www/js/app.js') diff --git a/www/js/app.js b/www/js/app.js index d65e6d33..4d076f30 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -66,6 +66,28 @@ angular.module('zmApp', [ desktopApiUrl: "/api/zm" }) + + +//------------------------------------------------------------------ +// switch between collection repeat or ng-repeat +//------------------------------------------------------------------- +.directive('repeat', function ($compile, $rootScope) { + return { + restrict: 'A', + priority: 2000, + terminal: true, + link: function (scope, element) { + var repeatDirective = ($rootScope.platformOS == 'desktop') ? 'ng-repeat' : 'collection-repeat'; + //console.log ("*********** REPEAT SCROLL IS " + repeatDirective); + + element.attr(repeatDirective, element.attr('repeat')); + element.removeAttr('repeat'); + $compile(element)(scope); + } + }; +}) + + //------------------------------------------------------------------ // I use this factory to share data between carousel and lazy load // carousel will not progress autoslide till imageLoading is 0 or -1 -- cgit v1.2.3