- improved "character switch" popover, #314

This commit is contained in:
Exodus4D
2016-09-20 20:31:52 +02:00
parent 7a187ecbb9
commit dfdb0034d5
5 changed files with 50 additions and 12 deletions

View File

@@ -33,6 +33,7 @@ define([
// head
headMapTrackingId: 'pf-head-map-tracking', // id for "map tracking" toggle (checkbox)
headCharacterSwitchId: 'pf-head-character-switch', // id for "character switch" popover
// menu
menuButtonFullScreenId: 'pf-menu-button-fullscreen', // id for menu button "fullscreen"
@@ -578,6 +579,7 @@ define([
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function (template, Mustache) {
var data = {
id: config.headCharacterSwitchId,
routes: Init.routes,
userData: userData,
otherCharacters: $.grep( userData.characters, function( character ) {
@@ -625,12 +627,14 @@ define([
popoverElement = $(this).data('bs.popover').tip();
popoverElement.velocity('transition.' + easeEffect, velocityOptions);
popoverElement.initTooltips();
}else{
popoverElement = $(this).data('bs.popover').tip();
if(popoverElement.is(':visible')){
popoverElement.velocity('reverse');
}else{
$(this).popover('show');
popoverElement.initTooltips();
popoverElement.velocity('transition.' + easeEffect, velocityOptions);
}
}

File diff suppressed because one or more lines are too long

View File

@@ -33,6 +33,7 @@ define([
// head
headMapTrackingId: 'pf-head-map-tracking', // id for "map tracking" toggle (checkbox)
headCharacterSwitchId: 'pf-head-character-switch', // id for "character switch" popover
// menu
menuButtonFullScreenId: 'pf-menu-button-fullscreen', // id for menu button "fullscreen"
@@ -578,6 +579,7 @@ define([
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function (template, Mustache) {
var data = {
id: config.headCharacterSwitchId,
routes: Init.routes,
userData: userData,
otherCharacters: $.grep( userData.characters, function( character ) {
@@ -625,12 +627,14 @@ define([
popoverElement = $(this).data('bs.popover').tip();
popoverElement.velocity('transition.' + easeEffect, velocityOptions);
popoverElement.initTooltips();
}else{
popoverElement = $(this).data('bs.popover').tip();
if(popoverElement.is(':visible')){
popoverElement.velocity('reverse');
}else{
$(this).popover('show');
popoverElement.initTooltips();
popoverElement.velocity('transition.' + easeEffect, velocityOptions);
}
}

View File

@@ -1,11 +1,28 @@
<div class="list-group">
{{#otherCharacters}}
<a class="list-group-item" href="{{routes.ssoLogin}}?characterId={{id}}">
<img src="https://image.eveonline.com/Character/{{id}}_32.jpg" alt="{{name}}">
{{name}}
</a>
{{/otherCharacters}}
<a class="list-group-item" target="_self" href="{{routes.ssoLogin}}?characterId=-1">
<i class="fa fa-user-plus fa-fw"></i>add new
</a>
</div>
<table id="{{id}}" class="table table-condensed">
<tbody>
{{#otherCharacters}}
<tr>
<td><img src="https://image.eveonline.com/Character/{{id}}_32.jpg" alt="{{name}}"></td>
<td>{{name}}</td>
<td class="text-right text-nowrap">
<a class="btn btn-sm btn-default" href="{{routes.ssoLogin}}?characterId={{id}}" target="_blank" title="new tab">
<i class="fa fa-fw fa-external-link"></i>
</a>
<a class="btn btn-sm btn-primary" href="{{routes.ssoLogin}}?characterId={{id}}" target="_self" title="switch&nbsp;character">
<i class="fa fa-fw fa-exchange"></i>
</a>
</td>
</tr>
{{/otherCharacters}}
<tr>
<td></td>
<td>add more</td>
<td class="text-right text-nowrap">
<a class="btn btn-sm btn-success" href="{{routes.ssoLogin}}?characterId=-1" target="_self">
<i class="fa fa-fw fa-user-plus"></i>&nbsp;&nbsp;
new character
</a>
</td>
</tr>
</tbody>
</table>

View File

@@ -827,6 +827,7 @@ table{
td{
padding: 0 5px;
vertical-align: middle !important;
}
}
}
@@ -1014,6 +1015,18 @@ td.pf-popover-trigger{
@include box-shadow(0 6px 12px rgba(0,0,0,.4));
}
// character switch popover
#pf-head-character-switch{
td{
border: none;
&:first-child + td{
// 2nd column
padding: 0 5px;
}
}
}
// footer (map) ===================================================================================
#pf-footer{
position: absolute;