Skip to content

Commit

Permalink
Read tree ID from detail page tree section header rather than field
Browse files Browse the repository at this point in the history
Instance managers can hide the tree ID field from view, which was breaking the
delete logic.
  • Loading branch information
jwalgran committed Dec 21, 2018
1 parent dc0428c commit 77fd050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions opentreemap/treemap/js/src/lib/plotDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var $ = require('jquery'),

var dom = {
form: '#map-feature-form',
treeIdColumn: '#tree-id-column',
treePresenceSection: '#tree-presence-section',
beginAddTree: '#begin-add-tree',
addTreeControls: '#add-tree-controls',
Expand All @@ -27,8 +26,8 @@ exports.init = function(form) {
.filter(R.complement(_.isUndefined))
.filter(R.complement(_.isNull));
}
var treeId = $(dom.treeIdColumn).attr('data-tree-id'),

var treeId = $(dom.treeSection).attr('data-tree-id'),
newTreeIdStream = excludeNullMap(form.saveOkStream,
'.responseData.treeId');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ <h3>{% trans "Tree Information" %}</h3>
{% include "treemap/partials/plot_detail_add_tree.html" %}

<!-- Tree Information -->
<div id="tree-details" {{ has_tree|yesno:",style=display:none;" }}>
{% if has_tree %}
<div id="tree-details" data-tree-id="{{ tree.id|unlocalize }}">
{% else %}
<div id="tree-details" style="display:none;">
{% endif %}
<table class="table table-hover">
<tbody>
{% for tuple in group.fields %}
Expand Down

0 comments on commit 77fd050

Please sign in to comment.