Use JSON so we don't have to parse data-rels manually (#3436).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11119 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
601148c5b1
commit
59ddbf8c09
|
@ -749,11 +749,7 @@ module Redmine
|
||||||
:class => "#{options[:css]} task_todo",
|
:class => "#{options[:css]} task_todo",
|
||||||
:id => html_id}
|
:id => html_id}
|
||||||
if options[:issue]
|
if options[:issue]
|
||||||
rels_hash = {}
|
content_opt[:data] = {"rels" => issue_relations(options[:issue]).to_json}
|
||||||
issue_relations(options[:issue]).each do |k, v|
|
|
||||||
rels_hash[k] = v.join(',')
|
|
||||||
end
|
|
||||||
content_opt[:data] = {"rels" => rels_hash}
|
|
||||||
end
|
end
|
||||||
output << view.content_tag(:div, ' '.html_safe, content_opt)
|
output << view.content_tag(:div, ' '.html_safe, content_opt)
|
||||||
if coords[:bar_late_end]
|
if coords[:bar_late_end]
|
||||||
|
|
|
@ -19,17 +19,14 @@ function getRelationsArray() {
|
||||||
var issue_id = element_id.replace("task-todo-issue-", "");
|
var issue_id = element_id.replace("task-todo-issue-", "");
|
||||||
var data_rels = $(element).data("rels");
|
var data_rels = $(element).data("rels");
|
||||||
if (data_rels != null) {
|
if (data_rels != null) {
|
||||||
for (rel_type_key in issue_relation_type) {
|
for (rel_type_key in data_rels) {
|
||||||
if (rel_type_key in data_rels) {
|
$.each(data_rels[rel_type_key], function(index_issue, element_issue) {
|
||||||
var issue_arr = data_rels[rel_type_key].toString().split(",");
|
|
||||||
$.each(issue_arr, function(index_issue, element_issue) {
|
|
||||||
arr.push({issue_from: issue_id, issue_to: element_issue,
|
arr.push({issue_from: issue_id, issue_to: element_issue,
|
||||||
rel_type: rel_type_key});
|
rel_type: rel_type_key});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue