Commit 009675f2 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes adding or removing lines and rtl display.

parent 25dd0b75
......@@ -19,6 +19,9 @@ var diploLine = LineBase.extend({
this.$parent.appendLine();
}.bind(this));
},
beforeDestroy() {
this.getEl().remove();
},
watch: {
'line.order': function(n,o) {
// make sure it's at the right place,
......@@ -28,12 +31,12 @@ var diploLine = LineBase.extend({
this.$el.parentNode.insertBefore(
this.$el,
this.$el.parentNode.children[this.line.order]);
this.setElContent(this.line.currentTrans.content);
}
},
'line.currentTrans': function(n, o) {
let line = this.getEl();
if (n!=undefined && n.content) {
line.textContent = n.content;
this.setElContent(n.content);
}
}
},
......@@ -41,6 +44,10 @@ var diploLine = LineBase.extend({
getEl() {
return this.$parent.editor.querySelector('div:nth-child('+parseInt(this.line.order+1)+')');
},
setElContent(content) {
let line = this.getEl();
line.textContent = content;
},
getRegion() {
return this.$parent.part.regions.findIndex(r => r.pk == this.line.region);
}
......
......@@ -275,7 +275,7 @@ var DiploPanel = BasePanel.extend({
update the size of the panel
*/
this.setHeight();
},
}
},
});
......@@ -615,8 +615,6 @@ i.panel-icon {
}
#diplomatic-lines div:before {
/* user-select: none; */
pointer-events: all;
text-align: center;
counter-increment: line;
content: counter(line);
......
......@@ -21,7 +21,16 @@
border-left: 1px solid lightgrey;
}
.rtl .line-content {
.rtl #diplomatic-lines div {
/* fixes table like alignment */
text-align: right;
margin-right: 50px;
margin-left: .5em;
}
.rtl #diplomatic-lines div:before {
margin-right: -50px;
margin-left: .5em;
border-left: 1px solid #ddd;
border-right: none;
}
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