Skip to content

Commit

Permalink
Avoid unnecessary horizontal scrollbars (#160)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
abraaoz committed Feb 28, 2020
1 parent 9eb6015 commit 4501c5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion css/common.css
Expand Up @@ -52,6 +52,6 @@ background: url(../images/add.png) left center no-repeat;


.data {
white-space: pre;
white-space: pre-wrap;
}

15 changes: 12 additions & 3 deletions css/index.css
Expand Up @@ -3,10 +3,14 @@ position: absolute;
top: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
width: 290px;
height: 100%;
}

#header {
padding-left: 10px;
border-right: 1px solid #000;
}

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


#keys {
flex-grow: 1;
width: 290px;
margin-top: 10px;
padding-left: 10px;
overflow: auto;
}
Expand All @@ -36,6 +42,7 @@ padding: 0;

#keys li {
font-weight: normal;
white-space: nowrap;
}

#keys li.folder {
Expand Down Expand Up @@ -115,6 +122,7 @@ background-color: #aaa;
cursor: col-resize;
padding: 0;
margin: 0;
border-left: 1px solid #000;
}

#resize-layover {
Expand All @@ -133,11 +141,12 @@ top: 0;
left: 305px;
right: 0;
bottom: 0;
padding-left: 2em;
}

#frame iframe {
width: 100%;
width: calc(100% - 3em);
height: 100%;
margin-left: 1.5em;
margin-right: 1.5em;
}

5 changes: 3 additions & 2 deletions index.php
Expand Up @@ -108,7 +108,7 @@ function print_namespace($item, $name, $fullkey, $islast) {
?>
<li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
<input type="checkbox" name="checked_keys" value="<?php echo $fullkey?>"/>
<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>
<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>
</li>
<?php
}
Expand Down Expand Up @@ -190,7 +190,7 @@ function getDbInfo($d, $info, $padding = '') {

?>
<div id="sidebar">

<div id="header">
<h1 class="logo"><a href="?overview&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>">phpRedisAdmin</a></h1>

<p>
Expand Down Expand Up @@ -247,6 +247,7 @@ function getDbInfo($d, $info, $padding = '') {
<button id="operations">
<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>
</button>
</div>
<div id="keys">
<ul>
<?php print_namespace($namespaces, 'Keys', '', empty($namespaces))?>
Expand Down

0 comments on commit 4501c5d

Please sign in to comment.