diff --git a/app/apps/core/static/js/edit/components/diplo_line.js b/app/apps/core/static/js/edit/components/diplo_line.js index 2d21e0b6f5cc1e6df0267f504e3fb3ca431cdf0e..8fb919733abe7dd004875c20118b46ec0df8a69d 100644 --- a/app/apps/core/static/js/edit/components/diplo_line.js +++ b/app/apps/core/static/js/edit/components/diplo_line.js @@ -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); } diff --git a/app/apps/core/static/js/edit/components/diplo_panel.js b/app/apps/core/static/js/edit/components/diplo_panel.js index 700c05882363b113fb4474f5273ffa5d328d9896..56c8e6ec22ab7b45dfcb40a5e42b29c340fad43f 100644 --- a/app/apps/core/static/js/edit/components/diplo_panel.js +++ b/app/apps/core/static/js/edit/components/diplo_panel.js @@ -275,7 +275,7 @@ var DiploPanel = BasePanel.extend({ update the size of the panel */ this.setHeight(); - }, + } }, }); diff --git a/app/escriptorium/static/css/escriptorium.css b/app/escriptorium/static/css/escriptorium.css index ddd80c4646051a6aa7071bb53ea7f4663b1dec2c..f85b34e0bcaacfe274859b635cc70480f3bfee7f 100644 --- a/app/escriptorium/static/css/escriptorium.css +++ b/app/escriptorium/static/css/escriptorium.css @@ -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); diff --git a/app/escriptorium/static/css/rtl.css b/app/escriptorium/static/css/rtl.css index 2ba555082d1ffb17f0c74d2742fb962563623f57..14d5db0b08d27a5dd590f1f64bdb561f57824b1b 100644 --- a/app/escriptorium/static/css/rtl.css +++ b/app/escriptorium/static/css/rtl.css @@ -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; }