summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-11-07 16:00:22 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-11-07 16:00:22 -0500
commitf5fa4aff8e9c9f9317d10dddf77c4f6a4607dea6 (patch)
tree430a5dc375c832b5f41aa5fd004e1305b905b61c /www/js
parent54cff0c8feba804371073eeda23310b59149dd55 (diff)
#67 - make mousewheel work in desktop mode
Former-commit-id: 804af14ecf932ca4f4bc2f3cbc4a3261cc096f30
Diffstat (limited to 'www/js')
-rw-r--r--www/js/app.js22
1 files changed, 22 insertions, 0 deletions
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