Skip to content

Commit

Permalink
Proper tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jul 8, 2015
1 parent 1cbd1ef commit 1ec0e1c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
17 changes: 16 additions & 1 deletion lhc_web/design/defaulttheme/tpl/lhchat/onlineusers.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ul>

<!-- Tab panes -->
<div class="tab-content">
<div class="tab-content" id="online-users-dashboard">
<div role="tabpanel" class="tab-pane active" id="onlineusers">
<?php include(erLhcoreClassDesign::designtpl('lhchat/onlineusers/section_online_users.tpl.php')); ?>
</div>
Expand All @@ -41,7 +41,22 @@
</div>
<?php include(erLhcoreClassDesign::designtpl('lhkernel/secure_links.tpl.php')); ?>
<script>

$( document ).ready(function() {
<?php if (!isset($popoverInitialized) || $popoverInitialized == false) : ?>
$('#dashboard-body, #onlineusers, #map').popover({
trigger:'hover',
html : true,
selector: '[data-toggle="popover"]',
content: function () {
return $('#popover-content-'+$(this).attr('data-chat-id')).html();
},
title: function () {
return $('#popover-title-'+$(this).attr('data-chat-id')).html();
}
});
<?php endif; ?>

lhinst.attachTabNavigator();
$('#right-column-page').removeAttr('id');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@
<td>

<div class="btn-group" role="group" aria-label="...">
<a class="btn btn-xs btn-default icon-info" data-placement="right" onmouseleave="$(this).tooltip('destroy')" onmouseover="$(this).tooltip({'html':true,'animation':false}).tooltip('show')" title="{{ou.notes_intro}}IP: {{ou.ip}}<br />{{ou.first_visit_front}} - <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','first visit');?><br/>{{ou.last_visit_front}} - <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','last visit');?><br/><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Pageviews');?> - {{ou.pages_count}} {{ou.identifier != '' ? '<br/>Identifier - '+ou.identifier : ''}}<br/>{{ou.operator_message == '' ? trans.first : ou.message_seen == 1 ? trans.second : trans.third}}<br />{{ou.user_agent}}" ng-click="online.showOnlineUserInfo(ou.id)"><img ng-src="<?php echo erLhcoreClassDesign::design('images/flags');?>/{{ou.user_country_code}}.png" alt="{{ou.user_country_name}}" /></a><?php include(erLhcoreClassDesign::designtpl('lhchat/onlineusers/custom_online_button_multiinclude.tpl.php')); ?><span ng-click="online.previewChat(ou)" class="btn btn-xs btn-success action-image" ng-show="ou.chat_id > 0"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Chat');?></span><span class="btn btn-xs btn-info icon-user" ng-show="ou.total_visits > 1"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Returning');?> ({{ou.total_visits}})</span><span class="btn btn-success btn-xs icon-user" ng-show="ou.total_visits == 1"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','New');?></span> <span title="{{ou.operator_user_string}} <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','has sent a message to the user');?>" class="btn btn-xs icon-comment" ng-show="ou.operator_message != ''" ng-class="ou.message_seen == 1 ? 'btn-success' : 'btn-danger'">{{ou.message_seen == 1 ? trans.msg_seen : trans.msg_not_seen}}</span><span class="btn btn-xs btn-primary up-case-first" ng-if="ou.user_country_code != ''">{{ou.user_country_name}}{{ou.city != '' ? ' | '+ou.city : ''}}</span><span class="btn btn-primary btn-xs icon-clock">{{ou.visitor_tz}} - {{ou.visitor_tz_time}}</span>
<a class="btn btn-xs btn-default icon-info" data-chat-id="{{ou.id}}" data-toggle="popover" data-placement="right" ng-click="online.showOnlineUserInfo(ou.id)"><img ng-src="<?php echo erLhcoreClassDesign::design('images/flags');?>/{{ou.user_country_code}}.png" alt="{{ou.user_country_name}}" /></a><?php include(erLhcoreClassDesign::designtpl('lhchat/onlineusers/custom_online_button_multiinclude.tpl.php')); ?><span ng-click="online.previewChat(ou)" class="btn btn-xs btn-success action-image" ng-show="ou.chat_id > 0"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Chat');?></span><span class="btn btn-xs btn-info icon-user" ng-show="ou.total_visits > 1"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Returning');?> ({{ou.total_visits}})</span><span class="btn btn-success btn-xs icon-user" ng-show="ou.total_visits == 1"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','New');?></span> <span title="{{ou.operator_user_string}} <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','has sent a message to the user');?>" class="btn btn-xs icon-comment" ng-show="ou.operator_message != ''" ng-class="ou.message_seen == 1 ? 'btn-success' : 'btn-danger'">{{ou.message_seen == 1 ? trans.msg_seen : trans.msg_not_seen}}</span><span class="btn btn-xs btn-primary up-case-first" ng-if="ou.user_country_code != ''">{{ou.user_country_name}}{{ou.city != '' ? ' | '+ou.city : ''}}</span><span class="btn btn-primary btn-xs icon-clock">{{ou.visitor_tz}} - {{ou.visitor_tz_time}}</span>
</div>



<div id="popover-content-{{ou.id}}" class="hide">
<ul class="list-unstyled">
<li>{{ou.notes_intro}}IP: {{ou.ip}}
<li>{{ou.first_visit_front}} - <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','first visit');?>
<li>{{ou.last_visit_front}} - <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','last visit');?>
<li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Pageviews');?> - {{ou.pages_count}} {{ou.identifier != '' ? ' Identifier - '+ou.identifier : ''}}
<li>{{ou.operator_message == '' ? trans.first : ou.message_seen == 1 ? trans.second : trans.third}}
<li>{{ou.user_agent}}
</ul>
</div>


<div class="page-url"><span><a target="_blank" href="{{ou.current_page}}" title="{{ou.current_page}}">{{ou.page_title || ou.current_page}}</a></span></div></td>
<td><div class="page-url"><span><a target="_blank" href="http:{{ou.referrer}}">{{ou.referrer}}</a></span></div></td>
<td>
<div style="width:80px">


<div class="btn-group" role="group" aria-label="...">
<a ng-click="online.sendMessage(ou.id)" class="btn btn-default btn-sm icon-comment" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers','Send message');?>"></a>
<a ng-click="online.deleteUser(ou,'<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/list','Are you sure?')?>');" class="btn btn-danger btn-sm icon-cancel-squared" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons','Delete');?>, ID - {{ou.id}}"></a>
</div>



</div>
</div>
</td>
</tr>
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
<?php endfor;?>
</div>

<?php $popoverInitialized = true; ?>
<script>
$( document ).ready(function() {
$('#dashboard-body').tooltip({ selector: '[data-toggle="tooltip"]' });
$('#dashboard-body').popover({
$('#dashboard-body, #onlineusers, #map').popover({
trigger:'hover',
html : true,
selector: '[data-toggle="popover"]',
Expand Down

0 comments on commit 1ec0e1c

Please sign in to comment.