Skip to content

Commit 6765c19

Browse files
debuggingsDonJayamanne
authored andcommitted
added a maximize/restore button to the details-view (DonJayamanne#118)
1 parent 0c69bc1 commit 6765c19

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

resources/main.css

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ body {
5353
#log-view.with-details {
5454
height: calc(100% - 20rem);
5555
}
56+
#log-view.with-details.with-details-resized {
57+
height: 20rem;
58+
}
5659

5760
#log-view svg {
5861
position: absolute;
@@ -283,21 +286,33 @@ body {
283286
border-bottom: none;
284287
}
285288

286-
#details-view .close-btn {
289+
#details-view.resized {
290+
height: calc(100% - 20rem);
291+
}
292+
293+
#details-view .action-btn {
287294
font-size: 1.2rem;
288-
position: absolute;
295+
float: right;
289296
padding: 1rem; /* increases the hit-area */
290-
top: 0;
291-
right: 0;
292297
cursor: pointer;
293298
opacity: 0.8;
294299
z-index: 5;
295300
}
296-
#details-view .close-btn:hover {
301+
#details-view .action-btn:hover {
297302
opacity: 1;
298303
transition: opacity 0.3s ease-out;
299304
}
300305

306+
#details-view.resized .action-btn.resize-btn{
307+
display: none;
308+
}
309+
#details-view .action-btn.resume-btn{
310+
display: none;
311+
}
312+
#details-view.resized .action-btn.resume-btn{
313+
display: block;
314+
}
315+
301316
#details-view .commit-subject {
302317
font-size: 1.4em;
303318
font-weight: lighter;

src/browser/detailsView.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
$detailsView
7979
.on('click', '.close-btn', hideDetails)
8080
;
81+
$detailsView
82+
.on('click', '.resize-btn', resizeDetails)
83+
;
84+
$detailsView
85+
.on('click', '.resume-btn', resumeDetails)
86+
;
8187
}
8288

8389
let detailsViewShown = false;
@@ -146,4 +152,12 @@
146152
$detailsView.addClass('hidden');
147153
$logView.removeClass('with-details');
148154
}
155+
function resizeDetails() {
156+
$detailsView.addClass('resized');
157+
$logView.addClass('with-details-resized');
158+
}
159+
function resumeDetails() {
160+
$detailsView.removeClass('resized');
161+
$logView.removeClass('with-details-resized');
162+
}
149163
})();

src/logViewer/htmlGenerator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ function generateHistoryListContainer(entries: LogEntry[], entriesHtml: string,
5555
</div>
5656
5757
<div id="details-view" class="hidden">
58-
<a class="close-btn"><i class="octicon octicon-x"></i></a>
58+
<a class="action-btn close-btn"><i class="octicon octicon-x"></i></a>
59+
<a class="action-btn resize-btn"><i class="octicon octicon-chevron-up"></i></a>
60+
<a class="action-btn resume-btn"><i class="octicon octicon-chevron-down"></i></a>
5961
<h1 class="commit-subject">Merged Pull request from some bug fix area</h1>
6062
<div class="commit-author">
6163
<span class="name hint--right hint--rounded hint--bounce" aria-label="don.jayamanne@yahoo.com">Don Jayamanne</span>

0 commit comments

Comments
 (0)