From c567f07a50994e1ee9dea2d3b3fbd1f9cc9fb003 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 10 Jun 2014 18:49:06 -0400 Subject: [PATCH] closes #338 ugly text labels. fixes error when trying to load topic page with a metacode set selected --- .../javascripts/Jit/graphsettings-event-handlers.js | 2 ++ app/assets/javascripts/Jit/jit2.0.0.js | 2 +- app/views/topics/_new.html.erb | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/Jit/graphsettings-event-handlers.js b/app/assets/javascripts/Jit/graphsettings-event-handlers.js index 0730e7f3..605a203c 100644 --- a/app/assets/javascripts/Jit/graphsettings-event-handlers.js +++ b/app/assets/javascripts/Jit/graphsettings-event-handlers.js @@ -205,6 +205,8 @@ function selectNodeOnClickHandler(node, e) { return; } + console.log(e); + var check = nodeWasDoubleClicked(); if (check) { nodeDoubleClickHandler(node, e); diff --git a/app/assets/javascripts/Jit/jit2.0.0.js b/app/assets/javascripts/Jit/jit2.0.0.js index 733d38e0..60cdb91c 100644 --- a/app/assets/javascripts/Jit/jit2.0.0.js +++ b/app/assets/javascripts/Jit/jit2.0.0.js @@ -7293,7 +7293,7 @@ Graph.Label.Native = new Class({ // START METAMAPS CODE var index; for (index = 0; index < customLabel.length; ++index) { - ctx.fillText(customLabel[index], pos.x, pos.y + node.getData("height") + 5 + (25*index)); + ctx.fillText(customLabel[index], pos.x, pos.y + node.getData("height") + 8 + (25*index)); } // END METAMAPS CODE }, diff --git a/app/views/topics/_new.html.erb b/app/views/topics/_new.html.erb index 2640b044..e3421ec3 100644 --- a/app/views/topics/_new.html.erb +++ b/app/views/topics/_new.html.erb @@ -9,9 +9,14 @@
<% @m = user.settings.metacodes %> - <% @metacodes = [] %> - <% @m.each do |m| %> - <% @metacodes.push(Metacode.find(m.to_i)) %> + <% set = @m[0].include?("metacodeset") ? MetacodeSet.find(@m[0].sub("metacodeset-","").to_i) : false %> + <% if set %> + <% @metacodes = set.metacodes %> + <% else %> + <% @metacodes = [] %> + <% @m.each do |m| %> + <% @metacodes.push(Metacode.find(m.to_i)) %> + <% end %> <% end %> <% @metacodes.sort! {|m1,m2| m2.name.downcase <=> m1.name.downcase }.rotate!(-1) %> <% @metacodes.each do |metacode| %>