Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Live/Controller.php2
-rw-r--r--plugins/Live/javascripts/visitorProfile.js11
-rw-r--r--plugins/Live/templates/getVisitorProfilePopup.twig4
3 files changed, 14 insertions, 3 deletions
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php
index 93e5249f74..16c0e6b6a3 100644
--- a/plugins/Live/Controller.php
+++ b/plugins/Live/Controller.php
@@ -174,7 +174,7 @@ class Controller extends \Piwik\Controller
$view = new View('@Live/getVisitList.twig');
$view->idSite = Common::getRequestVar('idSite', null, 'int');
- $view->startCounter = Common::getRequestVar('filter_offset', 1, 'int');
+ $view->startCounter = Common::getRequestVar('filter_offset', 0, 'int') + 1;
$view->visits = $nextVisits;
echo $view->render();
}
diff --git a/plugins/Live/javascripts/visitorProfile.js b/plugins/Live/javascripts/visitorProfile.js
index 4726734c4a..51197fb8ee 100644
--- a/plugins/Live/javascripts/visitorProfile.js
+++ b/plugins/Live/javascripts/visitorProfile.js
@@ -149,13 +149,15 @@
}, 'GET');
ajax.setCallback(function (response) {
if (response == "") { // no more visits left
- var noMoreSpan = $('<span/>').text(_pk_translate('Live_NoMoreVisits_js')).addClass('visitor-profile-no-visits');
- $('.visitor-profile-more-info', $element).html(noMoreSpan);
+ self._showNoMoreVisitsSpan();
} else {
response = $(response);
loading.hide();
$('.visitor-profile-visits', $element).append(response);
+ if (response.filter('li').length < 10) {
+ self._showNoMoreVisitsSpan();
+ }
piwikHelper.lazyScrollTo($(response)[0], 400, true);
}
@@ -164,6 +166,11 @@
ajax.send();
},
+ _showNoMoreVisitsSpan: function () {
+ var noMoreSpan = $('<span/>').text(_pk_translate('Live_NoMoreVisits_js')).addClass('visitor-profile-no-visits');
+ $('.visitor-profile-more-info', this.$element).html(noMoreSpan);
+ },
+
_loadIndividualVisitDetails: function ($visitElement) {
var self = this,
$element = this.$element,
diff --git a/plugins/Live/templates/getVisitorProfilePopup.twig b/plugins/Live/templates/getVisitorProfilePopup.twig
index a408f19a1a..bb30a5ee5f 100644
--- a/plugins/Live/templates/getVisitorProfilePopup.twig
+++ b/plugins/Live/templates/getVisitorProfilePopup.twig
@@ -85,7 +85,11 @@
</ol>
</div>
<div class="visitor-profile-more-info">
+ {% if visitorData.lastVisits.getRowsCount() >= constant("Piwik\\Plugins\\Live\\API::VISITOR_PROFILE_MAX_VISITS_TO_SHOW") %}
<a href="#">{{ 'Live_LoadMoreVisits'|translate }}</a> <img class="loadingPiwik" style="display:none;" src="plugins/Zeitgeist/images/loading-blue.gif"/>
+ {% else %}
+ <span class="visitor-profile-no-visits">{{ 'Live_NoMoreVisits_js'|translate }}</span>
+ {% endif %}
</div>
</div>
</div>