Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

explorer can be collapsed

  • Loading branch information...
commit c8d4f415d6cedd74ba9c5c69d2eef6fdb1d6828a 1 parent eac8018
Karl Seguin authored
View
1  app/views/home/index.html.erb
@@ -34,6 +34,7 @@
<div id="next" class="r"></div>
<div id="last" class="r"></div>
</div>
+ <div id="toggleExplorer"><div class="collapse"></div></div>
</div>
<script type="text/javascript">
$(document).ready(function()
View
BIN  public/images/left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
22 public/javascripts/console.js
@@ -15,9 +15,10 @@ $(document).ready(function()
$('#results').height(height - $('#history').height()-10);
$input.width($history.width()-20);
};
+
+ $('#toggleExplorer div').click(explorer.toggle);
});
-
var explorer = {};
explorer.collections =
{
@@ -39,5 +40,24 @@ explorer.collections =
{
executor.rawExecute('db.' + $(this).text() + '.stats();');
}
+};
+//this whole thing sucks!
+explorer.toggle = function()
+{
+ var $explorer = $('#explorer');
+ var $this = $(this);
+ var left = 0;
+ if ($explorer.is(':visible'))
+ {
+ $this.removeClass('collapse').addClass('expand');
+ $explorer.hide();
+ }
+ else
+ {
+ $this.removeClass('expand').addClass('collapse');
+ $explorer.show();
+ left = $explorer.width()+2;
+ }
+ $('#input').css({left: left, width: $('#history').width()-20});
}
context.register(explorer.collections.context);
View
8 public/stylesheets/console.css
@@ -2,17 +2,21 @@
#history{overflow:auto;height:250px;}
#results{overflow:auto;margin-top:37px;font-family:menlo, consolas, arial;}
-#explorer > div{display:none;}
+#collections{display:none;}
#explorer ul li{padding:4px 0 4px 10px;border-bottom:1px solid #eee;cursor:pointer;}
#explorer ul li:hover{background:#eee;}
#explorer h3{margin-left:5px;}
+#toggleExplorer{position:absolute;bottom:5px;left:5px;cursor:pointer;}
+#toggleExplorer div{width:20px;height:20px;}
+#toggleExplorer .collapse{background:url('../images/left.png') no-repeat}
+#toggleExplorer .expand{background:url('../images/right.png') no-repeat;}
#history > div {border-bottom:1px solid #e0e0e0;padding:5px;cursor:pointer;}
#history > div.error{background:#fee;}
#history > div.error:hover{background:#edd;}
#history > div.ok{background:#f0fff0;}
#history > div.ok:hover{background:#ded;}
-#history > div .time{float:right;}
+#history > div .time{float:right;;}
#input{overflow:hidden;position:absolute;top:298px;left:252px;height:12px;font-size:1em;padding:9px;font-family:menlo, consolas, arial;border:solid #ccc;border-width:1px 0;}
#input:focus{outline:none;}
Please sign in to comment.
Something went wrong with that request. Please try again.