Skip to content

Business intelligence made simple

Toggle code expansion

Andrew Kaned46ea179f7b4
diff --git a/app/assets/stylesheets/blazer/application.css b/app/assets/stylesheets/blazer/application.css
index 475bf704..fb18a493 100644
--- a/app/assets/stylesheets/blazer/application.css
+++ b/app/assets/stylesheets/blazer/application.css
@@ -165,3 +165,12 @@ input.search:focus {
#header a.active {
color: #999;
}
+
+#code {
+ max-height: 236px;
+ overflow: hidden;
+}
+
+#code.expanded {
+ max-height: none;
+}
diff --git a/app/views/blazer/queries/show.html.erb b/app/views/blazer/queries/show.html.erb
index 3b8e80e2..a67cbbce 100644
--- a/app/views/blazer/queries/show.html.erb
+++ b/app/views/blazer/queries/show.html.erb
@@ -135,7 +135,13 @@
</form>
<% end %>
-<pre style="max-height: 236px; overflow: hidden;" onclick="this.style.maxHeight = 'none';"><code><%= @statement %></code></pre>
+<pre id="code"><code><%= @statement %></code></pre>
+
+<script>
+ $("#code").click( function () {
+ $(this).toggleClass("expanded");
+ })
+</script>
<% if @success %>
<div id="results">