+ parseHtml: function(txt) {
+ return !txt.match(/<[/a-zA-Z]+>/)
+ ?
+ // No HTML tag
+ txt.replace(/\n\n/g, "<br/><div class='br'></div>")
+ .replace(/\n/g, "<br/>")
+ : txt;
+ },
+ adjustHeight: function() {
+ // https://stackoverflow.com/a/48460773
+ let t = document.querySelector("#player_" + this.uid + " textarea");
+ t.style.height = "";
+ t.style.height = (t.scrollHeight + 3) + "px";
+ },
+ toggleEdit: function() {
+ this.modeEdit = !this.modeEdit;
+ if (this.modeEdit) this.$nextTick(this.adjustHeight);
+ },