Commit bbf1e3d4 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

hiding button removed from customMap

parent 50d77142
...@@ -133,42 +133,6 @@ CustomMap.prototype.createBelt = function() { ...@@ -133,42 +133,6 @@ CustomMap.prototype.createBelt = function() {
this.divBelt = document.createElement('DIV'); this.divBelt = document.createElement('DIV');
this.divBelt.className = "headerBelt"; this.divBelt.className = "headerBelt";
var hideDivButton = document.createElement('DIV');
hideDivButton.className = "headerHideDivButton";
var hideButton = document.createElement('button');
hideButton.id = "hide_button";
hideButton.className = "headerHideButton";
hideButton.innerHTML = "<i class='fa fa-chevron-left'></i>";
// when there is no div to hide we should allow hiding
if (self.getHideDiv() !== undefined) {
hideButton.onclick = (function() {
var button = hideButton;
var div = self.getHideDiv();
var left = GuiConnector.getObjectByPrimefaceId(self.getGoogleMap().getDiv().id).offset().left;
return function() {
if (button.innerHTML.indexOf('fa-chevron-left') > 0) {
button.innerHTML = "<i class='fa fa-chevron-right'></i>";
div.style.display = 'none';
self.getGoogleMap().getDiv().style.left = "0px";
} else {
div.style.display = 'block';
button.innerHTML = "<i class='fa fa-chevron-left'></i>";
self.getGoogleMap().getDiv().style.left = left + "px";
}
google.maps.event.trigger(self.getGoogleMap(), 'resize');
return false;
};
})();
} else {
hideButton.disabled = true;
logger.warn("Left panel hiding disabled");
}
hideDivButton.appendChild(hideButton);
hideDivButton.index = 1; // used for ordering
this.divBelt.appendChild(hideDivButton);
var controlText = document.createElement('div'); var controlText = document.createElement('div');
controlText.className = "headerTextBold"; controlText.className = "headerTextBold";
controlText.innerHTML = this.getProject().getName(); controlText.innerHTML = this.getProject().getName();
......
...@@ -246,6 +246,19 @@ function create(params) { ...@@ -246,6 +246,19 @@ function create(params) {
legend.style.display="none"; legend.style.display="none";
} }
}; };
var hideButton = document.getElementsByName("hideButton")[0];
var panel = document.getElementsByName("leftPanel")[0];
var icon = document.getElementsByName("hideButtonIcon")[0];
hideButton.onclick = function(){
if (icon.className.indexOf("fa-chevron-left")>=0) {
icon.className = "fa fa-chevron-right";
leftPanel.style.display = "none";
} else {
icon.className = "fa fa-chevron-left";
leftPanel.style.display = "block";
}
google.maps.event.trigger(result.getGoogleMap(), 'resize');
};
if (ServerConnector.getSessionData().getShowComments()) { if (ServerConnector.getSessionData().getShowComments()) {
result.getControl(ControlType.COMMENT_CHECKBOX).checked=true; result.getControl(ControlType.COMMENT_CHECKBOX).checked=true;
return result.refreshComments(); return result.refreshComments();
......
...@@ -28,6 +28,42 @@ function Helper() { ...@@ -28,6 +28,42 @@ function Helper() {
this.idCounter = 1000000; this.idCounter = 1000000;
} }
Helper.prototype.createMenuDiv = function() {
var result = document.createElement("div");
var hideDiv = document.createElement("div");
result.appendChild(hideDiv);
var button = document.createElement("button");
button.setAttribute("name", "hideButton")
hideDiv.appendChild(button);
var icon = document.createElement("i");
icon.className = "fa fa-chevron-left";
icon.setAttribute("name", "hideButtonIcon");
button.appendChild(icon);
var legendCheckbox = document.createElement("input");
legendCheckbox.setAttribute("type", "checkbox");
legendCheckbox.setAttribute("name", "legendCheckbox");
result.appendChild(legendCheckbox);
return result;
};
Helper.prototype.createLeftPanelTab = function() {
var result = document.createElement("div");
result.appendChild(this.createSearchTab());
result.appendChild(this.createDrugTab());
result.appendChild(this.createChemicalTab());
result.appendChild(this.createMiRnaTab());
result.appendChild(this.createOverlayTab());
result.appendChild(this.createUserTab());
result.appendChild(this.createSubmapTab());
result.appendChild(this.createLegendDiv());
return result;
};
Helper.prototype.createSearchTab = function() { Helper.prototype.createSearchTab = function() {
return this.createPanelTab("searchTab"); return this.createPanelTab("searchTab");
}; };
...@@ -144,31 +180,19 @@ Helper.prototype.createSubmapTab = function() { ...@@ -144,31 +180,19 @@ Helper.prototype.createSubmapTab = function() {
return result; return result;
}; };
Helper.prototype.createMenuDiv = function() {
var result = document.createElement("div");
result.id = "menuDiv";
var legendCheckbox = document.createElement("input");
legendCheckbox.setAttribute("type", "checkbox");
legendCheckbox.setAttribute("name", "legendCheckbox");
result.appendChild(legendCheckbox);
return result;
};
Helper.prototype.createLegendDiv = function() { Helper.prototype.createLegendDiv = function() {
var result = document.createElement("div"); var result = document.createElement("div");
result.id = "legend"; result.id = "legend";
result.className= "carousel slide legendBox"; result.className = "carousel slide legendBox";
result.setAttribute("data-ride","carousel"); result.setAttribute("data-ride", "carousel");
var indicators = document.createElement("div"); var indicators = document.createElement("div");
indicators.className= "carousel-indicators"; indicators.className = "carousel-indicators";
indicators.setAttribute("name", "indicators"); indicators.setAttribute("name", "indicators");
result.appendChild(indicators); result.appendChild(indicators);
var slides = document.createElement("div"); var slides = document.createElement("div");
slides.className= "carousel-inner"; slides.className = "carousel-inner";
slides.setAttribute("name", "slides"); slides.setAttribute("name", "slides");
slides.setAttribute("role", "listbox"); slides.setAttribute("role", "listbox");
result.appendChild(slides); result.appendChild(slides);
...@@ -230,7 +254,7 @@ Helper.prototype.createDbOverlay = function(map) { ...@@ -230,7 +254,7 @@ Helper.prototype.createDbOverlay = function(map) {
map : map, map : map,
name : "search", name : "search",
}); });
result.clear = function(){ result.clear = function() {
logger.debug("Clear mock"); logger.debug("Clear mock");
}; };
map.registerSource(result); map.registerSource(result);
...@@ -316,9 +340,9 @@ Helper.prototype.createProject = function() { ...@@ -316,9 +340,9 @@ Helper.prototype.createProject = function() {
Helper.prototype.createUser = function() { Helper.prototype.createUser = function() {
var result = new User({ var result = new User({
login : "testlogin", login : "testlogin",
id: this.idCounter++, id : this.idCounter++,
name: "some name", name : "some name",
surname: "surn", surname : "surn",
}); });
return result; return result;
}; };
......
...@@ -18,43 +18,15 @@ describe('minerva global', function() { ...@@ -18,43 +18,15 @@ describe('minerva global', function() {
}); });
beforeEach(function() { beforeEach(function() {
global.searchTab = helper.createSearchTab(); global.leftPanelTab = helper.createLeftPanelTab();
document.body.appendChild(global.searchTab); document.body.appendChild(global.leftPanelTab);
global.drugTab = helper.createDrugTab();
document.body.appendChild(global.drugTab);
global.chemicalTab = helper.createChemicalTab();
document.body.appendChild(global.chemicalTab);
global.mirnaTab = helper.createMiRnaTab();
document.body.appendChild(global.mirnaTab);
global.overlayTab = helper.createOverlayTab();
document.body.appendChild(global.overlayTab);
global.userTab = helper.createUserTab();
document.body.appendChild(global.userTab);
global.submapTab = helper.createSubmapTab();
document.body.appendChild(global.submapTab);
global.legendDiv = helper.createLegendDiv();
document.body.appendChild(global.legendDiv);
global.menuDiv = helper.createMenuDiv(); global.menuDiv = helper.createMenuDiv();
document.body.appendChild(global.menuDiv); document.body.appendChild(global.menuDiv);
}); });
afterEach(function() { afterEach(function() {
document.body.removeChild(global.searchTab); document.body.removeChild(global.leftPanelTab);
document.body.removeChild(global.drugTab);
document.body.removeChild(global.chemicalTab);
document.body.removeChild(global.mirnaTab);
document.body.removeChild(global.overlayTab);
document.body.removeChild(global.userTab);
document.body.removeChild(global.submapTab);
document.body.removeChild(global.legendDiv);
document.body.removeChild(global.menuDiv); document.body.removeChild(global.menuDiv);
}); });
......
...@@ -115,7 +115,12 @@ function initMap(){ ...@@ -115,7 +115,12 @@ function initMap(){
</div> </div>
<div style="display: table-cell;height:100%;width:100%;"> <div style="display: table-cell;height:100%;width:100%;">
<div id="menuDiv" style="background-color:#ff0000;float:left;width:100%;height:30px "> <div class="menuBelt">
<div class="headerHideDivButton">
<button name="hideButton" class="headerHideButton">
<i name="hideButtonIcon" class='fa fa-chevron-left'/>
</button>
</div>
<input type="checkbox" name ="legendCheckbox" /> <input type="checkbox" name ="legendCheckbox" />
<label for ="legendCheckbox" >LEGEND</label> <label for ="legendCheckbox" >LEGEND</label>
</div> </div>
......
.menuBelt {
width: 100%;
min-height: 36px;
height: auto;
float: left;
z-index: -1;
background: #13ACE0;
background: -moz-linear-gradient(top, #2CCAFE, #13ACE0);
background: -webkit-gradient(linear, left top, left bottom, from(#2CCAFE),
to(#13ACE0));
}
.headerBelt {
width: 100%;
min-height: 36px;
height: auto;
position: absolute;
top: 0;
left: 0;
z-index: -1;
background: #13ACE0;
background: -moz-linear-gradient(top, #2CCAFE, #13ACE0);
background: -webkit-gradient(linear, left top, left bottom, from(#2CCAFE),
to(#13ACE0));
}
.headerHideDivButton {
display: inline;
width: auto;
height: 36px;
float: left
}
.headerHideButton {
color: #FFFFFF;
height: 36px;
line-height: 36px;
padding: 0 16px;
margin: 0;
border: none;
background-color: transparent;
font-size: 20px;
border-right: 1px solid #9DE1F8;
cursor: pointer;
transition: background-color 0.4s ease-in-out 0s;
}
.headerHideButton:hover {
background-color: #01536D;
transition: background-color 0.4s ease-in-out 0s;
}
.headerTextBold {
display: inline;
width: auto;
height: 36px;
float: left;
line-height: 36px;
padding: 0 17px;
color: #FFFFFF;
font-weight: 900;
font-size: 13px;
text-align: center;
border-right: 1px solid #9DE1F8;
}
.legendBox { .legendBox {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
right:10px; right: 10px;
box-shadow:0 3px 20px #999999; box-shadow: 0 3px 20px #999999;
border-top:6px solid #017DA7; border-top: 6px solid #017DA7;
padding-top:15px; padding-top: 15px;
}; }
;
.searchPanel { .searchPanel {
height: 100%; height: 100%;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -120,4 +187,4 @@ ...@@ -120,4 +187,4 @@
.tt-suggestion.tt-cursor { .tt-suggestion.tt-cursor {
color: #fff; color: #fff;
background-color: #0097cf; background-color: #0097cf;
} }
\ No newline at end of file
...@@ -1034,12 +1034,6 @@ a.mainTitle:hover {background-color:#000000; transition: background-color 0.4s e ...@@ -1034,12 +1034,6 @@ a.mainTitle:hover {background-color:#000000; transition: background-color 0.4s e
#footerLinks a:link, #footerLinks a:visited {text-decoration:none; font-size:13px; font-weight:900; color:#ffffff; transition: all 0.4s ease-in-out 0s;} #footerLinks a:link, #footerLinks a:visited {text-decoration:none; font-size:13px; font-weight:900; color:#ffffff; transition: all 0.4s ease-in-out 0s;}
#footerLinks a:hover {color:#999999; transition: all 0.4s ease-in-out 0s;} #footerLinks a:hover {color:#999999; transition: all 0.4s ease-in-out 0s;}
.headerBelt {width:100%; min-height:36px; height:auto; position:absolute; top:0; left:0; z-index:-1; background:#13ACE0; background:-moz-linear-gradient(top,#2CCAFE,#13ACE0); background:-webkit-gradient(linear,left top,left bottom,from(#2CCAFE),to(#13ACE0)); }
.headerHideDivButton {display:inline; width:auto; height:36px; float:left}
.headerHideButton { color:#FFFFFF; height:36px; line-height:36px; padding:0 16px; margin:0; border:none; background-color:transparent; font-size:20px; border-right:1px solid #9DE1F8; cursor:pointer; transition: background-color 0.4s ease-in-out 0s;}
.headerHideButton:hover {background-color:#01536D; transition: background-color 0.4s ease-in-out 0s; }
.headerTextBold {display:inline; width:auto; height:36px; float:left; line-height:36px; padding:0 17px; color:#FFFFFF; font-weight:900; font-size:13px; text-align:center;border-right:1px solid #9DE1F8; }
.overview_button {color:#FFFFFF; height:36px; line-height:35px; padding:0 18px; margin:0; border:none; background-color:#017DA7; font-size:13px; font-weight:900; border-right:1px solid #9DE1F8; cursor:pointer; transition: background-color 0.4s ease-in-out 0s; } .overview_button {color:#FFFFFF; height:36px; line-height:35px; padding:0 18px; margin:0; border:none; background-color:#017DA7; font-size:13px; font-weight:900; border-right:1px solid #9DE1F8; cursor:pointer; transition: background-color 0.4s ease-in-out 0s; }
.overview_button:hover {background-color:#01536D; transition: background-color 0.4s ease-in-out 0s; } .overview_button:hover {background-color:#01536D; transition: background-color 0.4s ease-in-out 0s; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment