]> source.dussan.org Git - redmine.git/commitdiff
Only process issues that have relations.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 5 Jan 2013 12:41:24 +0000 (12:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 5 Jan 2013 12:41:24 +0000 (12:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11120 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/helpers/gantt.rb
public/javascripts/gantt.js

index 3238de8cfa7c0d61ef2979cf810b94f2e8077c17..a760a3466737cf8d7e139409daef69b768af47e9 100644 (file)
@@ -749,7 +749,10 @@ module Redmine
                          :class => "#{options[:css]} task_todo",
                          :id => html_id}
           if options[:issue]
-            content_opt[:data] = {"rels" => issue_relations(options[:issue]).to_json}
+            rels = issue_relations(options[:issue])
+            if rels.present?
+              content_opt[:data] = {"rels" => rels.to_json}
+            end
           end
           output << view.content_tag(:div, '&nbsp;'.html_safe, content_opt)
           if coords[:bar_late_end]
index 51e2257e03e1bbe5a2b2804377b5cbff6a3ea9d5..066a1588466b38526713722c2a56aba0315c79af 100644 (file)
@@ -13,18 +13,16 @@ function setDrawArea() {
 
 function getRelationsArray() {
   var arr = new Array();
-  $.each($('div.task_todo'), function(index_div, element) {
+  $.each($('div.task_todo[data-rels]'), function(index_div, element) {
     var element_id = $(element).attr("id");
     if (element_id != null) {
       var issue_id = element_id.replace("task-todo-issue-", "");
       var data_rels = $(element).data("rels");
-      if (data_rels != null) {
-        for (rel_type_key in data_rels) {
-          $.each(data_rels[rel_type_key], function(index_issue, element_issue) {
-            arr.push({issue_from: issue_id, issue_to: element_issue,
-                      rel_type: rel_type_key});
-          });
-        }
+      for (rel_type_key in data_rels) {
+        $.each(data_rels[rel_type_key], function(index_issue, element_issue) {
+          arr.push({issue_from: issue_id, issue_to: element_issue,
+                    rel_type: rel_type_key});
+        });
       }
     }
   });