diff options
Diffstat (limited to 'plugins/Live/javascripts/visitorProfile.js')
-rw-r--r-- | plugins/Live/javascripts/visitorProfile.js | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/plugins/Live/javascripts/visitorProfile.js b/plugins/Live/javascripts/visitorProfile.js index cbe05e0ec7..148ec3b731 100644 --- a/plugins/Live/javascripts/visitorProfile.js +++ b/plugins/Live/javascripts/visitorProfile.js @@ -62,9 +62,6 @@ _setupControl: function () { // focus the popup so it will accept key events this.$element.focus(); - - // highlight the first visit - $('.visitor-profile-visits>li:first-child', this.$element).addClass('visitor-profile-current-visit'); }, _bindEventCallbacks: function () { @@ -80,20 +77,30 @@ return false; }); - $element.on('click', '.visitor-profile-more-info>a', function (e) { + $element.on('click', '.visitor-profile-toggle-actions', function (e) { e.preventDefault(); - self._loadMoreVisits(); + $(this).toggleClass('minimized'); + if ($(this).hasClass('minimized')) { + $('.visitor-profile-actions', $element).slideUp(); + } else { + $('.visitor-profile-actions', $element).slideDown(); + } return false; }); - $element.on('click', '.visitor-profile-see-more-cvars>a', function (e) { + $element.on('click', '.visitor-profile-more-info>a', function (e) { e.preventDefault(); - $('.visitor-profile-extra-cvars', $element).slideToggle(); + self._loadMoreVisits(); return false; }); - $element.on('click', '.visitor-profile-visit-title-row', function () { - self._loadIndividualVisitDetails($('h2', this)); + $element.on('click', '.visitor-profile-visit-title', function () { + $('.visitor-profile-visit-details-extended', $(this).parents('li')).slideToggle(); + }); + + $element.on('click', '.visitor-profile-show-actions', function () { + $('.visitor-profile-actions', $(this).parents('li')).slideToggle(); + return false; }); $element.on('click', '.visitor-profile-prev-visitor', function (e) { @@ -140,10 +147,14 @@ }); $element.tooltip({ + items: '[title],.visitorLogIconWithDetails', track: true, show: false, hide: false, content: function() { + if ($(this).hasClass('visitorLogIconWithDetails')) { + return $('<ul>').html($('ul', $(this)).html()); + } var title = $(this).attr('title'); return $('<a>').text( title ).html().replace(/\n/g, '<br />'); }, @@ -207,7 +218,8 @@ period: '', date: '', visitorId: $element.attr('data-visitor-id'), - filter_offset: $('.visitor-profile-visits>li', $element).length + filter_offset: $('.visitor-profile-visits>li', $element).length, + start_number: $('.visitor-profile-visits>li:last', $element).data('number') - 1 }, 'GET'); ajax.setCallback(function (response) { if (response == "") { // no more visits left @@ -233,37 +245,6 @@ $('.visitor-profile-more-info', this.$element).html(noMoreSpan); }, - _loadIndividualVisitDetails: function ($visitElement) { - var self = this, - $element = this.$element, - visitId = $visitElement.attr('data-idvisit'); - - $('.visitor-profile-avatar .loadingPiwik', $element).css('display', 'inline-block'); - piwikHelper.lazyScrollTo($('.visitor-profile-avatar', $element)[0], 400); - - var ajax = new ajaxHelper(); - ajax.addParams({ - module: 'Live', - action: 'getSingleVisitSummary', - visitId: visitId, - idSite: piwik.idSite - }, 'GET'); - ajax.setCallback(function (response) { - $('.visitor-profile-avatar .loadingPiwik', $element).hide(); - - $('.visitor-profile-current-visit', $element).removeClass('visitor-profile-current-visit'); - $visitElement.closest('li').addClass('visitor-profile-current-visit'); - - var $latestVisitSection = $('.visitor-profile-latest-visit', $element); - $latestVisitSection - .html(response) - .parent() - .effect('highlight', {color: '#FFFFCB'}, 1200); - }); - ajax.setFormat('html'); - ajax.send(); - }, - _loadPreviousVisitor: function () { this._gotoAdjacentVisitor(this.$element.attr('data-prev-visitor')); }, |