summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/external/angular-carousel.js34
-rw-r--r--www/js/ModalCtrl.js6
2 files changed, 34 insertions, 6 deletions
diff --git a/www/external/angular-carousel.js b/www/external/angular-carousel.js
index 4a853981..1b65d32c 100644
--- a/www/external/angular-carousel.js
+++ b/www/external/angular-carousel.js
@@ -56,12 +56,15 @@ angular.module('angular-carousel')
var toggleAutoPlay = function() {
//scope.rnForceStop = !scope.rnForceStop;
carouselUtils.setStop(!carouselUtils.getStop());
+ if (carouselUtils.isStopped())
+ carouselUtils.setIndex (scope.carouselIndex);
//console.log ("Autoplay is " + carouselUtils.get());
if (scope.autoSlider )
{
// PP - If autoslide was on and we tapped, stop auto slide
//scope.rnForceStop = true; //PP
carouselUtils.setStop (true);
+ carouselUtils.setIndex (scope.carouselIndex);
console.log ("***RN: Stopping Play rnForceStop is "+carouselUtils.getStop());
stopAutoPlay();
}
@@ -70,6 +73,7 @@ angular.module('angular-carousel')
//scope.rnForceStop = false; //PP
carouselUtils.setStop (false);
console.log ("***RN: Starting Play rnForceStop is "+carouselUtils.getStop());
+ //scope.carouselIndex = carouselUtils.getIndex();
restartTimer();
}
};
@@ -255,6 +259,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
.factory ('carouselUtils', function() {
var isstopped = false;
var duration = 0;
+ var stoppedIndex = 0;
return {
setDuration: function (val)
@@ -271,6 +276,20 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
setStop: function(val)
{
isstopped = val;
+ if (isstopped)
+ {
+ console.log ("Paused at " + stoppedIndex);
+ }
+ },
+
+ setIndex: function(val)
+ {
+ stoppedIndex = val;
+ console.log ("setting saved index to " + stoppedIndex);
+ },
+ getIndex: function()
+ {
+ return stoppedIndex;
},
getStop: function()
{
@@ -432,15 +451,18 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
}
scope.nextSlide = function(slideOptions) {
- if (carouselUtils.isStopped()==true)
+ if (carouselUtils.isStopped()==true)
+ {
+ console.log ("Just updated index, but we are stopped");
return;
-
- var index = scope.carouselIndex + 1;
+ }
+ var index = scope.carouselIndex + 1;
if (index > currentSlides.length - 1) {
//PP
index--;
}
- //console.log ("inside next slide with index = " + index);
+
+ //console.log ("inside next slide with index = " + index);
// PP - we keep moving the index but don't load so it looks nicer
// and we don't mess up the rate
if (imageLoadingDataShare.get() != 1) // PP- If the image is still being loaded, hold on, don't change
@@ -621,6 +643,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
}
}, mydurms);
}
+ else { console.log ("We are stopped, doing nothing"); }
};
}
@@ -643,7 +666,8 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
if (angular.isFunction(indexModel.assign)) {
/* check if this property is assignable then watch it */
scope.$watch('carouselIndex', function(newValue) {
- if (carouselUtils.isStopped() == false)
+ //if (carouselUtils.isStopped() == false)
+ //console.log ("Carouselc chanhed 1");
updateParentIndex(newValue);
});
scope.$parent.$watch(function () {
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js
index 166142f1..8c48201a 100644
--- a/www/js/ModalCtrl.js
+++ b/www/js/ModalCtrl.js
@@ -1464,16 +1464,20 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
if (typeof $scope.ionRange !== 'undefined') {
$scope.$watch('ionRange.index', function () {
//
+ $scope.mycarousel.index = parseInt($scope.ionRange.index) - 1;
+
if (carouselUtils.getStop() == true)
return;
- $scope.mycarousel.index = parseInt($scope.ionRange.index) - 1;
+
// console.log ("***ION RANGE CHANGED TO " + $scope.mycarousel.index);
});
}
if (typeof $scope.mycarousel !== 'undefined') {
$scope.$watch('mycarousel.index', function () {
+
+
//console.log ("***ION MYCAROUSEL CHANGED");