Commit f6382625 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes pagination leaving empty lines behind.

parent d5e8a73b
......@@ -20,7 +20,10 @@ var diploLine = LineBase.extend({
}.bind(this));
},
beforeDestroy() {
this.getEl().remove();
let el = this.getEl();
if (el != null) {
el.remove();
}
},
watch: {
/* 'line.order': function(n,o) {
......
......@@ -8,6 +8,14 @@ var DiploPanel = BasePanel.extend({
components: {
'diploline': diploLine,
},
watch: {
'part.loaded': function(isLoaded, wasLoaded) {
if (!isLoaded) {
// changed page probably
this.empty();
}
}
},
created() {
// vue.js quirck, have to dinamically create the event handler
// call save every 10 seconds after last change
......@@ -35,6 +43,11 @@ var DiploPanel = BasePanel.extend({
this.saveNotif = this.$el.querySelector('.tools #save-notif');
},
methods: {
empty() {
while (this.editor.hasChildNodes()) {
this.editor.removeChild(this.editor.lastChild);
}
},
toggleSort() {
if (this.editor.contentEditable === 'true') {
this.editor.contentEditable = 'false';
......
......@@ -566,6 +566,7 @@
<div id="diplomatic-lines"
contenteditable="true"
autocomplete="off"
@keydown="onKeyPress"
@keyup="constrainLineNumber"
@input="changed"
......
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