Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f6382625 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes pagination leaving empty lines behind.

parent d5e8a73b
Branches
Tags
1 merge request!43Feature/one block
...@@ -20,7 +20,10 @@ var diploLine = LineBase.extend({ ...@@ -20,7 +20,10 @@ var diploLine = LineBase.extend({
}.bind(this)); }.bind(this));
}, },
beforeDestroy() { beforeDestroy() {
this.getEl().remove(); let el = this.getEl();
if (el != null) {
el.remove();
}
}, },
watch: { watch: {
/* 'line.order': function(n,o) { /* 'line.order': function(n,o) {
......
...@@ -8,6 +8,14 @@ var DiploPanel = BasePanel.extend({ ...@@ -8,6 +8,14 @@ var DiploPanel = BasePanel.extend({
components: { components: {
'diploline': diploLine, 'diploline': diploLine,
}, },
watch: {
'part.loaded': function(isLoaded, wasLoaded) {
if (!isLoaded) {
// changed page probably
this.empty();
}
}
},
created() { created() {
// vue.js quirck, have to dinamically create the event handler // vue.js quirck, have to dinamically create the event handler
// call save every 10 seconds after last change // call save every 10 seconds after last change
...@@ -35,6 +43,11 @@ var DiploPanel = BasePanel.extend({ ...@@ -35,6 +43,11 @@ var DiploPanel = BasePanel.extend({
this.saveNotif = this.$el.querySelector('.tools #save-notif'); this.saveNotif = this.$el.querySelector('.tools #save-notif');
}, },
methods: { methods: {
empty() {
while (this.editor.hasChildNodes()) {
this.editor.removeChild(this.editor.lastChild);
}
},
toggleSort() { toggleSort() {
if (this.editor.contentEditable === 'true') { if (this.editor.contentEditable === 'true') {
this.editor.contentEditable = 'false'; this.editor.contentEditable = 'false';
......
...@@ -566,6 +566,7 @@ ...@@ -566,6 +566,7 @@
<div id="diplomatic-lines" <div id="diplomatic-lines"
contenteditable="true" contenteditable="true"
autocomplete="off"
@keydown="onKeyPress" @keydown="onKeyPress"
@keyup="constrainLineNumber" @keyup="constrainLineNumber"
@input="changed" @input="changed"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment