From 9a37e7cd9fac0dd0da9cc7ce20e9d07335c9d078 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 9 May 2014 14:24:28 -0400 Subject: [PATCH] Fixes to visit and visibility --- src/definitions/behaviors/visibility.js | 11 ++++++++--- src/definitions/behaviors/visit.js | 14 +++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/definitions/behaviors/visibility.js b/src/definitions/behaviors/visibility.js index f73f5ad98..854a728e4 100755 --- a/src/definitions/behaviors/visibility.js +++ b/src/definitions/behaviors/visibility.js @@ -169,11 +169,16 @@ $.fn.visibility = function(parameters) { $module .attr('src', src) ; - if($.fn.transition !== undefined || offScreen) { - $module.transition(settings.transition, settings.duration); + if(offScreen) { + $module.show(); } else { - $module.fadeIn(settings.duration); + if($.fn.transition !== undefined) { + $module.transition(settings.transition, settings.duration); + } + else { + $module.fadeIn(settings.duration); + } } } }, diff --git a/src/definitions/behaviors/visit.js b/src/definitions/behaviors/visit.js index 5a3d7b1f5..4e0d05e9d 100755 --- a/src/definitions/behaviors/visit.js +++ b/src/definitions/behaviors/visit.js @@ -170,7 +170,7 @@ $.visit = $.fn.visit = function(parameters) { reset: function() { module.store(settings.key.count, 0); - module.store(settings.key.ids, ''); + module.store(settings.key.ids, null); }, add: { @@ -230,14 +230,14 @@ $.visit = $.fn.visit = function(parameters) { check: { limit: function(value) { value = value || module.get.count(); - if(value >= settings.limit) { - module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit); - $.proxy(settings.onLimit, this)(value); - } - else if(settings.limit) { + if(settings.limit) { + if(value >= settings.limit) { + module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit); + $.proxy(settings.onLimit, this)(value); + } module.debug('Limit not reached', value, settings.limit); + $.proxy(settings.onChange, this)(value); } - $.proxy(settings.onChange, this)(value); module.update.display(value); } },