Commit 16c39259 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Determine network height based on window size

parent 6aa34c0e
class Network
constructor: (opts) ->
$("#filter_ref").click ->
$(this).closest('form').submit()
branch_graph = new BranchGraph($(".network-graph"), opts)
vph = $(window).height() - 250
$('.network-graph').css 'height': (vph + 'px')
@Network = Network
.graph_holder { .project-network {
border: 1px solid #aaa; border: 1px solid #aaa;
padding: 1px; padding: 1px;
.tip {
h4 { color: #888;
margin: 0; font-size: 14px;
padding: 10px; padding: 10px;
border-bottom: 1px solid #bbb; border-bottom: 1px solid #bbb;
@include bg-gray-gradient; @include bg-gray-gradient;
} }
.graph { .network-graph {
background: #f1f1f1; background: #f1f1f1;
height: 500px; height: 500px;
overflow-y: scroll; overflow-y: scroll;
......
= render "head" = render "head"
.graph_holder .project-network
%h4 .tip
%small You can move around the graph by using the arrow keys. You can move around the graph by using the arrow keys.
#holder.graph .network-graph
.loading.loading-gray .loading.loading-gray
:javascript :javascript
var branch_graph; new Network({
$("#filter_ref").click(function() {
$(this).closest('form').submit();
});
branch_graph = new BranchGraph($("#holder"), {
url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}', url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}',
commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}',
ref: '#{@ref}', ref: '#{@ref}',
commit_id: '#{@commit.id}' commit_id: '#{@commit.id}'
}); })
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment