Andrew Kane 8 лет назад
Родитель
Сommit
d46ea179f7

+ 9 - 0
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;
+}

+ 7 - 1
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">