Commit 46951309 authored by gijs's avatar gijs

Back to only two children per line to make nestedSortable behave better

parent 1a077a4a
This diff is collapsed.
......@@ -952,7 +952,9 @@ window.W = window.W || {};
rangeType: rangeType,
isLink: (this.link) ? true : false,
hasSublines: hasSublines,
hasAttachment: hasAttachment
hasAttachment: hasAttachment,
sublineAlternative: this.getAltSymbol(),
sublineTag: (hasSublines) ? this.model.get('sublines').first().get('tag') : ''
}
},
......@@ -962,7 +964,9 @@ window.W = window.W || {};
},
regions: {
tree: { el: '.sublines'
tree: {
el: '.sublines',
replaceElement: true
},
form: {
......@@ -1062,6 +1066,25 @@ window.W = window.W || {};
},
getAltSymbol: function () {
var alternative = this.model.get("alternative");
if (alternative) {
if (alternative.type === rangeType.undetermined) {
return "indéterminé";
} else if (alternative.type === rangeType.exact) {
return alternative.value;
} else if (alternative.type === rangeType.minimal) {
return alternative.value + "+";
} else if (alternative.type === rangeType.range) {
return alternative.value[0] + "-" + alternative.value[1];
}
}
return "";
},
/**
* Adapter function between old and new alternative field
* temporary
......@@ -1471,8 +1494,8 @@ window.W = window.W || {};
});
W.TreeView = Marionette.CollectionView.extend({
template: '#node-tree-template',
childViewContainer: 'ol',
className: 'sublines',
tagName: 'ol',
initialize: function () {
this.listenTo(this.collection, 'change:tag', this.updateTag);
......
......@@ -97,9 +97,16 @@
</span>
<form></form>
<div class="sublines__metadata__wrapper">
<div class="sublines__metadata">
<span class="tag" data-tag="<%- sublineTag %>"></span>
<% if (sublineAlternative != "") { %>
<span class="alternative"><%- sublineAlternative %></span>
<% } %>
</div>
</div>
</header>
<% if (sublines.length) { %>
<section class="sublines"></section>
<% } %>
<ol class="sublines"></ol>
{% endspaceless %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment