Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(info-panel): fix info-panel full height button
Browse files Browse the repository at this point in the history
  • Loading branch information
reinoute committed May 10, 2016
1 parent 9c54c25 commit ee033c9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ html,
bottom: 0;
background-color: #d3d3d3;
width: 100%;
height: 50%;
overflow-y: hidden;
padding: 1em;
padding: 0 5px 1em 5px;
border-bottom: 1px solid #ccc;
-webkit-transition: height .5s;
transition: height .5s;
}
.viewer-info.is-maximized {
height: 100%;
}
.viewer-info-close {
position: absolute;
top: 1em;
Expand Down
3 changes: 2 additions & 1 deletion src/modules/app/app.tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<button class="viewer-button viewer-icon-info-outline { 'is-active': infoIsOpen }"
title="toggle module info"
disabled="{ !activeModule.info }"
onclick="{ toggleInfo }"></button>
onclick="{ toggleInfo }"
aria-controls="info-panel"></button>
<button class="viewer-button viewer-icon-label" title="toggle annotations"
disabled></button>

Expand Down
18 changes: 15 additions & 3 deletions src/modules/info-panel/info-panel.tag.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<info-panel class="viewer-info" style="height:60%;">
<info-panel class="viewer-info { 'is-maximized': isMaximized }" id="info-panel" aria-expanded="true">

<header class="viewer-info-header">
<nav class="viewer-info-nav">
Expand All @@ -13,9 +13,9 @@
</nav>

<div class="viewer-info-control">
<button class="viewer-button viewer-icon-align-top" title=""></button>
<button class="viewer-button viewer-icon-align-top" title="" onclick="{ toggleMaximize }"></button>
<button class="viewer-button viewer-icon-clear" title="close info panel"
onclick="{ opts.onClose }"></button>
onclick="{ onClose }"></button>
</div>
</header>

Expand All @@ -27,8 +27,11 @@
<script>
var tag = this;
tag.activeSection = undefined;
tag.isMaximized = false;
opts.sections = {};
tag.onSelectSection = onSelectSection;
tag.onClose = onClose;
tag.toggleMaximize = toggleMaximize;
tag.on('update', onUpdate);

function onSelectSection(event) {
Expand All @@ -41,5 +44,14 @@
tag.activeSection = Object.keys(tag.sections)[0];
}
}

function toggleMaximize() {
tag.isMaximized = !tag.isMaximized;
}

function onClose() {
opts.onClose();
tag.isMaximized = false;
}
</script>
</info-panel>

0 comments on commit ee033c9

Please sign in to comment.