Skip to content

Commit 4501c5d

Browse files
authored
Avoid unnecessary horizontal scrollbars (#160)
* Avoid unnecessary horizontal scrollbars Fix long key values rendering with horizontal scrollbar; Fix keys folder with checkbox in one line and key name in another line. * Ellipsis replaced by horizontal scrollbar while keeping elements aligned #160 (comment) * Fix missing padding on the right frame in Firefox for Mac #160 (comment)
1 parent 9eb6015 commit 4501c5d

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

css/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ background: url(../images/add.png) left center no-repeat;
5252

5353

5454
.data {
55-
white-space: pre;
55+
white-space: pre-wrap;
5656
}
5757

css/index.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ position: absolute;
33
top: 0;
44
bottom: 0;
55
left: 0;
6+
display: flex;
7+
flex-direction: column;
68
width: 290px;
79
height: 100%;
10+
}
11+
12+
#header {
813
padding-left: 10px;
9-
border-right: 1px solid #000;
1014
}
1115

1216
#sidebar a, #sidebar a:visited {
@@ -23,7 +27,9 @@ text-decoration: underline;
2327

2428

2529
#keys {
30+
flex-grow: 1;
2631
width: 290px;
32+
margin-top: 10px;
2733
padding-left: 10px;
2834
overflow: auto;
2935
}
@@ -36,6 +42,7 @@ padding: 0;
3642

3743
#keys li {
3844
font-weight: normal;
45+
white-space: nowrap;
3946
}
4047

4148
#keys li.folder {
@@ -115,6 +122,7 @@ background-color: #aaa;
115122
cursor: col-resize;
116123
padding: 0;
117124
margin: 0;
125+
border-left: 1px solid #000;
118126
}
119127

120128
#resize-layover {
@@ -133,11 +141,12 @@ top: 0;
133141
left: 305px;
134142
right: 0;
135143
bottom: 0;
136-
padding-left: 2em;
137144
}
138145

139146
#frame iframe {
140-
width: 100%;
147+
width: calc(100% - 3em);
141148
height: 100%;
149+
margin-left: 1.5em;
150+
margin-right: 1.5em;
142151
}
143152

index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function print_namespace($item, $name, $fullkey, $islast) {
108108
?>
109109
<li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
110110
<input type="checkbox" name="checked_keys" value="<?php echo $fullkey?>"/>
111-
<a href="?view&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
111+
<a href="?view&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($fullkey)?>" title="<?php echo format_html($name)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
112112
</li>
113113
<?php
114114
}
@@ -190,7 +190,7 @@ function getDbInfo($d, $info, $padding = '') {
190190

191191
?>
192192
<div id="sidebar">
193-
193+
<div id="header">
194194
<h1 class="logo"><a href="?overview&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>">phpRedisAdmin</a></h1>
195195

196196
<p>
@@ -247,6 +247,7 @@ function getDbInfo($d, $info, $padding = '') {
247247
<button id="operations">
248248
<a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&batch_del=1" class="batch_del">Delete selected<img src="images/delete.png" style="width: 1em;height: 1em;vertical-align: middle;" title="Delete selected" alt="[X]"></a>
249249
</button>
250+
</div>
250251
<div id="keys">
251252
<ul>
252253
<?php print_namespace($namespaces, 'Keys', '', empty($namespaces))?>

0 commit comments

Comments
 (0)