summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/network.js.coffee11
-rw-r--r--app/assets/stylesheets/sections/graph.scss10
-rw-r--r--app/views/projects/network/show.html.haml16
3 files changed, 22 insertions, 15 deletions
diff --git a/app/assets/javascripts/network.js.coffee b/app/assets/javascripts/network.js.coffee
new file mode 100644
index 00000000000..cea5986f45a
--- /dev/null
+++ b/app/assets/javascripts/network.js.coffee
@@ -0,0 +1,11 @@
+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
diff --git a/app/assets/stylesheets/sections/graph.scss b/app/assets/stylesheets/sections/graph.scss
index cdf3a23c608..156ecdeeffc 100644
--- a/app/assets/stylesheets/sections/graph.scss
+++ b/app/assets/stylesheets/sections/graph.scss
@@ -1,16 +1,16 @@
-.graph_holder {
+.project-network {
border: 1px solid #aaa;
padding: 1px;
-
- h4 {
- margin: 0;
+ .tip {
+ color: #888;
+ font-size: 14px;
padding: 10px;
border-bottom: 1px solid #bbb;
@include bg-gray-gradient;
}
- .graph {
+ .network-graph {
background: #f1f1f1;
height: 500px;
overflow-y: scroll;
diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml
index a480ceaf995..492f77341f7 100644
--- a/app/views/projects/network/show.html.haml
+++ b/app/views/projects/network/show.html.haml
@@ -1,18 +1,14 @@
= render "head"
-.graph_holder
- %h4
- %small You can move around the graph by using the arrow keys.
- #holder.graph
+.project-network
+ .tip
+ You can move around the graph by using the arrow keys.
+ .network-graph
.loading.loading-gray
:javascript
- var branch_graph;
- $("#filter_ref").click(function() {
- $(this).closest('form').submit();
- });
- branch_graph = new BranchGraph($("#holder"), {
+ new Network({
url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}',
commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}',
ref: '#{@ref}',
commit_id: '#{@commit.id}'
- });
+ })