Merge git://github.com/jonatkins/ingress-intel-total-conversion into dev

This commit is contained in:
Morgan Jones 2013-05-06 13:13:33 -06:00
commit 38b1034830
3 changed files with 13 additions and 10 deletions

View File

@ -359,16 +359,21 @@ window.updateDisplayedLayerGroup = function(name, display) {
// Read layerGroup status from window.overlayStatus if it was added to map,
// read from cookie if it has not added to map yet.
// return true if both overlayStatus and cookie didn't have the record
window.isLayerGroupDisplayed = function(name) {
// return 'defaultDisplay' if both overlayStatus and cookie didn't have the record
window.isLayerGroupDisplayed = function(name, defaultDisplay) {
if(typeof(overlayStatus[name]) !== 'undefined') return overlayStatus[name];
var layersJSON = readCookie('ingress.intelmap.layergroupdisplayed');
if(!layersJSON) return true;
if(!layersJSON) return defaultDisplay;
var layers = JSON.parse(layersJSON);
// keep latest overlayStatus
overlayStatus = $.extend(layers, overlayStatus);
if(typeof(overlayStatus[name]) === 'undefined') return true;
if(typeof(overlayStatus[name]) === 'undefined') return defaultDisplay;
return overlayStatus[name];
}
window.addLayerGroup = function(name, layerGroup, defaultDisplay) {
if(isLayerGroupDisplayed(name, defaultDisplay)) map.addLayer(layerGroup);
layerChooser.addOverlay(layerGroup, name);
}

View File

@ -106,9 +106,7 @@ window.plugin.keysOnMap.setupCSS = function() {
}
window.plugin.keysOnMap.setupLayer = function() {
window.layerChooser.addOverlay(window.plugin.keysOnMap.keyLayerGroup, 'Keys');
if(isLayerGroupDisplayed('Keys'))
map.addLayer(window.plugin.keysOnMap.keyLayerGroup);
window.addLayerGroup('Keys', window.plugin.keysOnMap.keyLayerGroup, false);
}
var setup = function() {

View File

@ -45,7 +45,7 @@ body {
margin-top: -31px; /* -(toggle height / 2) */
line-height: 10px;
position: absolute;
top: 325px; /* (sidebar height / 2) */
top: 108px;
z-index: 3001;
background-color: rgba(8, 48, 78, 0.9);
color: #FFCE00;
@ -53,7 +53,7 @@ body {
border-right: none;
border-radius: 5px 0 0 5px;
text-decoration: none;
right: 301px; /* overwritten later by the script with SIDEBAR_WIDTH */
right: -50px; /* overwritten later by the script with SIDEBAR_WIDTH */
}
.enl {
@ -652,7 +652,7 @@ h3 {
* content when first selecting a portal) */
#portaldetails {
min-height: 485px;
min-height: 63px;
position: relative; /* so the below '#portaldetails .close' is relative to this */
}