SFJS 0.3.4

This commit is contained in:
Mo Bitar
2018-07-22 18:52:18 -05:00
parent 47f1d68874
commit ebef028096
2 changed files with 1 additions and 20 deletions

View File

@@ -1,28 +1,9 @@
class NoteHistoryEntry extends SFItemHistoryEntry {
setPreviousEntry(previousEntry) {
super.setPreviousEntry(previousEntry);
if(previousEntry) {
this.textCharDiffLength = this.item.content.text.length - previousEntry.item.content.text.length;
} else {
this.textCharDiffLength = this.item.content.text.length;
}
}
previewTitle() {
return this.item.updated_at.toLocaleString();
}
operationVector() {
if(!this.hasPreviousEntry || this.textCharDiffLength == 0) {
return 0;
} else if(this.textCharDiffLength < 0) {
return -1;
} else {
return 1;
}
}
previewSubTitle() {
if(!this.hasPreviousEntry) {
return `${this.textCharDiffLength} characters loaded`