Commit c7586871 authored by gijs's avatar gijs

Added depth impression for collapsed lines, some more visual feedback on linked axes

parent 8565ed29
This diff is collapsed.
......@@ -814,7 +814,6 @@ window.W = window.W || {};
aspectChoices: ["duratif", "itératif", "sémelfactif"],
alternativeChoices: ["inclusive", "exclusive"],
tagChoices: tags,
altSymbol: this.getAltSymbol(),
hasIndications: this.hasIndications(),
showTag: this.showTag(),
rangeType: rangeType,
......@@ -1246,35 +1245,6 @@ window.W = window.W || {};
this.$el.attr("data-collapsed", state.collapsed[this.model.cid]);
},
getAltSymbol: function () {
var parent = this.model.get("parent");
if (parent) {
var alternative = parent.get("alternative");
var altSymbol = "";
if (alternative) {
if (alternative.type === rangeType.undetermined) {
altSymbol = "V<sub>indeterminé</sub>";
} else if (alternative.type === rangeType.exact) {
if (alternative.value === 1) {
altSymbol = "V";
} else {
altSymbol = "V<sub>" + alternative.value + "</sub>";
}
} else if (alternative.type === rangeType.minimal) {
altSymbol = "V<sub>" + alternative.value + "+</sub>";
} else if (alternative.type === rangeType.range) {
altSymbol = "V<sub>" + alternative.value[0] + "-" + alternative.value[1] + "</sub>";
}
}
return altSymbol;
}
return "";
},
addLine: function (minimal) {
// AJouter une subline
// makes sure the line is unfolded to see the new line.
......@@ -1423,7 +1393,8 @@ window.W = window.W || {};
attributes: function () {
return {
'data-tag': this.collection.first().get('tag')
'data-tag': this.collection.first().get('tag'),
'data-alternative': this.getAltSymbol()
}
},
......@@ -1432,6 +1403,25 @@ window.W = window.W || {};
this.children.each(function (child) {
child.triggerMethod('expandUntill', level);
});
},
getAltSymbol: function () {
var alternative = this.collection.parent.get("alternative");
if (alternative) {
if (alternative.type === rangeType.undetermined) {
return "indeterminé";
} 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 "";
}
});
......
......@@ -2,8 +2,6 @@
<section class="axis-row--header">
<span class="icon icon--handle"></span>
<span class="alt-symbol"><%= altSymbol %></span>
</section>
<section class="axis-row--body">
......@@ -13,7 +11,7 @@
<% } %>
<span class="axis-title">
<%- title %><!-- <% if (!hasSublines) { %>.<% } %> --></span>
<%- title %>
<% if (adresse) { %>
<span class="adresse">
......@@ -96,9 +94,9 @@
<button name="unlink"><%- t('rompre le lien') %></button>
<% } else { %>
<button name="link"><%- t('créer un axe lié') %></button>
<button name="edit" title="Modifier cet axe"><%- t('éditer') %></button>
<button name="add" title="Ajoute un sous-axe">+</button>
<% } %>
<button name="edit" title="Modifier cet axe"><%- t('éditer') %></button>
<button name="add" title="Ajoute un sous-axe">+</button>
<button name="delete" title="Supprimer cet axe (et tous ses sous-axes)">x</button>
<% if (sublines.length) { %>
<!-- <button name="toggle"></button> -->
......
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