- added new system tooltip for "region name", closed #236
- updated "Bootstrap" JS-library 3.3.0 -> 3.3.5
This commit is contained in:
@@ -213,7 +213,6 @@ class Setup extends Controller {
|
||||
$data = [];
|
||||
$tmpVal = (object) [];
|
||||
foreach ($jsonIterator as $key => $val) {
|
||||
//var_dump($data);
|
||||
if(is_array($val)) {
|
||||
if(isset($tmpVal->name)){
|
||||
$data[] = $tmpVal;
|
||||
@@ -235,7 +234,7 @@ class Setup extends Controller {
|
||||
SELECT
|
||||
id
|
||||
FROM " . $pfDB->quotekey(Model\BasicModel::getNew('WormholeModel')->getTable()) . "
|
||||
WHERE " . $ccpDB->quotekey('name') . " = :name",
|
||||
WHERE " . $pfDB->quotekey('name') . " = :name",
|
||||
[':name' => $name]
|
||||
);
|
||||
$id = (int)$result[0]['id'];
|
||||
|
||||
@@ -3423,6 +3423,11 @@ define([
|
||||
if(newMap){
|
||||
// init custom scrollbars and add overlay
|
||||
parentElement.initMapScrollbar();
|
||||
|
||||
// show static overlay actions
|
||||
var mapElement = mapConfig.map.getContainer();
|
||||
var mapOverlay = $(mapElement).getMapOverlay('info');
|
||||
mapOverlay.updateOverlayIcon('systemRegion', 'show');
|
||||
}
|
||||
|
||||
// callback function after tab switch
|
||||
|
||||
@@ -14,34 +14,85 @@ define([
|
||||
logTimerCount: 3, // map log timer in seconds
|
||||
|
||||
// map
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapWrapperClass: 'pf-map-wrapper', // wrapper div (scrollable)
|
||||
|
||||
// map overlays
|
||||
mapOverlayClass: 'pf-map-overlay', // class for all map overlays
|
||||
mapOverlayTimerClass: 'pf-map-overlay-timer', // class for map overlay timer e.g. map timer
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info' // class for map overlay info e.g. map info
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info', // class for map overlay info e.g. map info
|
||||
|
||||
// system
|
||||
systemHeadClass: 'pf-system-head' // class for system head
|
||||
};
|
||||
|
||||
// overlay options (all available map options shown in overlay)
|
||||
/**
|
||||
* Overlay options (all available map options shown in overlay)
|
||||
* "active": (active || hover) indicated whether an icon/option
|
||||
* is marked as "active".
|
||||
* "active": Makes icon active when visible
|
||||
* "hover": Make icon active on hover
|
||||
*/
|
||||
var options = {
|
||||
filter: {
|
||||
title: 'active filter',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-filter',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-filter']
|
||||
},
|
||||
mapSnapToGrid: {
|
||||
title: 'active grid',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-grid',
|
||||
iconClass: ['glyphicon', 'glyphicon-th']
|
||||
},
|
||||
mapMagnetizer: {
|
||||
title: 'active magnetizer',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-magnetizer',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-magnet']
|
||||
},
|
||||
systemRegion: {
|
||||
title: 'show regions',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-region',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-tags'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).each(function(){
|
||||
var system = $(this);
|
||||
// init tooltip if not already exists
|
||||
if ( !system.data('bs.tooltip') ){
|
||||
system.tooltip({
|
||||
container: mapElement,
|
||||
placement: 'right',
|
||||
title: function(){ console.log($(this).parent()); console.log($(this).parent().data('region'));
|
||||
return $(this).parent().data('region');
|
||||
},
|
||||
trigger: 'manual'
|
||||
});
|
||||
}
|
||||
system.tooltip('show');
|
||||
});
|
||||
},
|
||||
out: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).tooltip('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapElement from overlay or any child of that
|
||||
* @param mapOverlay
|
||||
* @returns {JQuery}
|
||||
*/
|
||||
var getMapFromOverlay = function(mapOverlay){
|
||||
return $(mapOverlay).parents('.' + config.mapWrapperClass).find('.' + config.mapClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get map overlay element by type e.g. timer/counter, info - overlay
|
||||
* @param overlayType
|
||||
@@ -203,9 +254,24 @@ define([
|
||||
if(iconElement){
|
||||
if(viewType === 'show'){
|
||||
showOverlay = true;
|
||||
iconElement.velocity('fadeIn');
|
||||
|
||||
// check "trigger" and mark as "active"
|
||||
if(options[option].trigger === 'active'){
|
||||
iconElement.addClass('active');
|
||||
}
|
||||
|
||||
// display animation for icon
|
||||
iconElement.velocity({
|
||||
opacity: [0.8, 0],
|
||||
scale: [1, 0],
|
||||
width: ['26px', 0],
|
||||
marginLeft: ['3px', 0]
|
||||
},{
|
||||
duration: 240,
|
||||
easing: 'easeInOutQuad'
|
||||
});
|
||||
}else if(viewType === 'hide'){
|
||||
iconElement.hide();
|
||||
iconElement.removeClass('active').velocity('reverse');
|
||||
|
||||
// check if there is any visible icon remaining
|
||||
var visibleIcons = mapOverlayInfo.find('i:visible');
|
||||
@@ -253,14 +319,20 @@ define([
|
||||
// add all overlay elements
|
||||
for (var prop in options) {
|
||||
if(options.hasOwnProperty(prop)){
|
||||
mapOverlayInfo.append(
|
||||
$('<i>', {
|
||||
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')
|
||||
}).attr('title', options[prop].title).tooltip({
|
||||
placement: 'left',
|
||||
container: 'body'
|
||||
})
|
||||
);
|
||||
var icon = $('<i>', {
|
||||
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')
|
||||
}).attr('title', options[prop].title).tooltip({
|
||||
placement: 'left',
|
||||
container: 'body',
|
||||
delay: 150
|
||||
});
|
||||
|
||||
// add "hover" action for some icons
|
||||
if(options[prop].trigger === 'hover'){
|
||||
icon.hoverIntent(options[prop].hoverIntent);
|
||||
}
|
||||
|
||||
mapOverlayInfo.append(icon);
|
||||
}
|
||||
}
|
||||
parentElement.append(mapOverlayInfo);
|
||||
|
||||
10
js/lib/bootstrap.min.js
vendored
10
js/lib/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3423,6 +3423,11 @@ define([
|
||||
if(newMap){
|
||||
// init custom scrollbars and add overlay
|
||||
parentElement.initMapScrollbar();
|
||||
|
||||
// show static overlay actions
|
||||
var mapElement = mapConfig.map.getContainer();
|
||||
var mapOverlay = $(mapElement).getMapOverlay('info');
|
||||
mapOverlay.updateOverlayIcon('systemRegion', 'show');
|
||||
}
|
||||
|
||||
// callback function after tab switch
|
||||
|
||||
@@ -14,34 +14,85 @@ define([
|
||||
logTimerCount: 3, // map log timer in seconds
|
||||
|
||||
// map
|
||||
mapClass: 'pf-map', // class for all maps
|
||||
mapWrapperClass: 'pf-map-wrapper', // wrapper div (scrollable)
|
||||
|
||||
// map overlays
|
||||
mapOverlayClass: 'pf-map-overlay', // class for all map overlays
|
||||
mapOverlayTimerClass: 'pf-map-overlay-timer', // class for map overlay timer e.g. map timer
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info' // class for map overlay info e.g. map info
|
||||
mapOverlayInfoClass: 'pf-map-overlay-info', // class for map overlay info e.g. map info
|
||||
|
||||
// system
|
||||
systemHeadClass: 'pf-system-head' // class for system head
|
||||
};
|
||||
|
||||
// overlay options (all available map options shown in overlay)
|
||||
/**
|
||||
* Overlay options (all available map options shown in overlay)
|
||||
* "active": (active || hover) indicated whether an icon/option
|
||||
* is marked as "active".
|
||||
* "active": Makes icon active when visible
|
||||
* "hover": Make icon active on hover
|
||||
*/
|
||||
var options = {
|
||||
filter: {
|
||||
title: 'active filter',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-filter',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-filter']
|
||||
},
|
||||
mapSnapToGrid: {
|
||||
title: 'active grid',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-grid',
|
||||
iconClass: ['glyphicon', 'glyphicon-th']
|
||||
},
|
||||
mapMagnetizer: {
|
||||
title: 'active magnetizer',
|
||||
trigger: 'active',
|
||||
class: 'pf-map-overlay-magnetizer',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-magnet']
|
||||
},
|
||||
systemRegion: {
|
||||
title: 'show regions',
|
||||
trigger: 'hover',
|
||||
class: 'pf-map-overlay-region',
|
||||
iconClass: ['fa', 'fa-fw', 'fa-tags'],
|
||||
hoverIntent: {
|
||||
over: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).each(function(){
|
||||
var system = $(this);
|
||||
// init tooltip if not already exists
|
||||
if ( !system.data('bs.tooltip') ){
|
||||
system.tooltip({
|
||||
container: mapElement,
|
||||
placement: 'right',
|
||||
title: function(){ console.log($(this).parent()); console.log($(this).parent().data('region'));
|
||||
return $(this).parent().data('region');
|
||||
},
|
||||
trigger: 'manual'
|
||||
});
|
||||
}
|
||||
system.tooltip('show');
|
||||
});
|
||||
},
|
||||
out: function(e){
|
||||
var mapElement = getMapFromOverlay(this);
|
||||
mapElement.find('.' + config.systemHeadClass).tooltip('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapElement from overlay or any child of that
|
||||
* @param mapOverlay
|
||||
* @returns {JQuery}
|
||||
*/
|
||||
var getMapFromOverlay = function(mapOverlay){
|
||||
return $(mapOverlay).parents('.' + config.mapWrapperClass).find('.' + config.mapClass);
|
||||
};
|
||||
|
||||
/**
|
||||
* get map overlay element by type e.g. timer/counter, info - overlay
|
||||
* @param overlayType
|
||||
@@ -203,9 +254,24 @@ define([
|
||||
if(iconElement){
|
||||
if(viewType === 'show'){
|
||||
showOverlay = true;
|
||||
iconElement.velocity('fadeIn');
|
||||
|
||||
// check "trigger" and mark as "active"
|
||||
if(options[option].trigger === 'active'){
|
||||
iconElement.addClass('active');
|
||||
}
|
||||
|
||||
// display animation for icon
|
||||
iconElement.velocity({
|
||||
opacity: [0.8, 0],
|
||||
scale: [1, 0],
|
||||
width: ['26px', 0],
|
||||
marginLeft: ['3px', 0]
|
||||
},{
|
||||
duration: 240,
|
||||
easing: 'easeInOutQuad'
|
||||
});
|
||||
}else if(viewType === 'hide'){
|
||||
iconElement.hide();
|
||||
iconElement.removeClass('active').velocity('reverse');
|
||||
|
||||
// check if there is any visible icon remaining
|
||||
var visibleIcons = mapOverlayInfo.find('i:visible');
|
||||
@@ -253,14 +319,20 @@ define([
|
||||
// add all overlay elements
|
||||
for (var prop in options) {
|
||||
if(options.hasOwnProperty(prop)){
|
||||
mapOverlayInfo.append(
|
||||
$('<i>', {
|
||||
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')
|
||||
}).attr('title', options[prop].title).tooltip({
|
||||
placement: 'left',
|
||||
container: 'body'
|
||||
})
|
||||
);
|
||||
var icon = $('<i>', {
|
||||
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')
|
||||
}).attr('title', options[prop].title).tooltip({
|
||||
placement: 'left',
|
||||
container: 'body',
|
||||
delay: 150
|
||||
});
|
||||
|
||||
// add "hover" action for some icons
|
||||
if(options[prop].trigger === 'hover'){
|
||||
icon.hoverIntent(options[prop].hoverIntent);
|
||||
}
|
||||
|
||||
mapOverlayInfo.append(icon);
|
||||
}
|
||||
}
|
||||
parentElement.append(mapOverlayInfo);
|
||||
|
||||
10
public/js/v1.1.2/lib/bootstrap.min.js
vendored
10
public/js/v1.1.2/lib/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -83,22 +83,31 @@ $mapWidth: 2500px ;
|
||||
min-width: 36px;
|
||||
|
||||
i{
|
||||
display: none;
|
||||
margin: 2px;
|
||||
width: 26px;
|
||||
margin: 0; // overwrite default
|
||||
margin-top: 3px;
|
||||
width: 0; // is animated
|
||||
height: 26px;
|
||||
opacity: 0.8;
|
||||
color: $orange-dark;
|
||||
opacity: 0; // is animated
|
||||
color: $gray-light;
|
||||
transform: scale(0);
|
||||
transform-origin: 50% 50% 0px;
|
||||
@include transition( color .18s ease-in-out );
|
||||
cursor: help;
|
||||
will-change: all;
|
||||
|
||||
&.fa{
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
&.glyphicon{
|
||||
margin-left: 4px;
|
||||
font-size: 25px;
|
||||
margin-top: 3px;
|
||||
font-size: 24px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
&.active, &:hover{
|
||||
color: $orange-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user